xfs
[Top] [All Lists]

Re: [PATCH 4/7] xfs: add xfs_btree_check_lptr_disk

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH 4/7] xfs: add xfs_btree_check_lptr_disk
From: Nathan Scott <nathans@xxxxxxx>
Date: Wed, 12 Jul 2006 10:49:21 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20060710170420.GD26786@xxxxxx>; from hch@xxxxxx on Mon, Jul 10, 2006 at 07:04:20PM +0200
References: <20060710170420.GD26786@xxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.2.5i
Hi Christoph,

On Mon, Jul 10, 2006 at 07:04:20PM +0200, Christoph Hellwig wrote:
> --- xfs-2.6.x.orig/fs/xfs/xfs_bmap_btree.c    2006-07-09 19:28:16.000000000 
> +0200
> +++ xfs-2.6.x/fs/xfs/xfs_bmap_btree.c 2006-07-09 19:37:01.000000000 +0200
> @@ -382,7 +382,7 @@
>               pp = XFS_BMAP_PTR_IADDR(block, 1, cur);
>  #ifdef DEBUG
>               for (i = ptr; i < numrecs; i++) {
> -                     if ((error = xfs_btree_check_lptr(cur, INT_GET(pp[i], 
> ARCH_CONVERT), level))) {
> +                     if ((error = xfs_btree_check_lptr_disk(cur, pp, 
> level))) {

This incorrectly changes the debug-only btree checking here, no?

> --- xfs-2.6.x.orig/fs/xfs/xfs_btree.h 2006-07-09 19:34:52.000000000 +0200
> +++ xfs-2.6.x/fs/xfs/xfs_btree.h      2006-07-09 19:37:01.000000000 +0200
> @@ -243,6 +243,9 @@
>       xfs_dfsbno_t            ptr,    /* btree block disk address */
>       int                     level); /* btree block level */
>  
> +#define xfs_btree_check_lptr_disk(cur, ptr, level) \
> +     xfs_btree_check_lptr(cur, INT_GET(ptr, ARCH_CONVERT), level)
> +

Shouldn't this be using be64_to_cpu() instead of the old school
INT_GET?  Maybe static inline here for type checking?  *shrug*.

thanks.

-- 
Nathan


<Prev in Thread] Current Thread [Next in Thread>