xfs
[Top] [All Lists]

Re: [PATCH 21/21] clean up xfs_bmap_btree.c

To: Christoph Hellwig <hch@xxxxxx>
Subject: Re: [PATCH 21/21] clean up xfs_bmap_btree.c
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 30 Jul 2008 17:32:45 +1000
Cc: xfs@xxxxxxxxxxx
In-reply-to: <20080729193200.GV19104@xxxxxx>
Mail-followup-to: Christoph Hellwig <hch@xxxxxx>, xfs@xxxxxxxxxxx
References: <20080729193200.GV19104@xxxxxx>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.18 (2008-05-17)
On Tue, Jul 29, 2008 at 09:32:00PM +0200, Christoph Hellwig wrote:
> From: Dave Chinner <dgc@xxxxxxx>
> 
> Reimplement xfs_bmbt_newroot and xfs_bmbt_kill_root using the new generic
> btree helpers and clean out all cruft needed for the old implementations.
> 
> This requires exporting some functionality from xfs_btree.c that's only
> used locally otherwise.
> 
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
.....
> +     nrecs += i;
> +     xfs_btree_set_numrecs(block, nrecs);
> +
> +     ASSERT(nrecs == crecs);
> +     kp = xfs_bmbt_key_addr(cur, 1, block);
> +     ckp = xfs_bmbt_key_addr(cur, 1, cblock);
> +     memcpy(kp, ckp, nrecs * sizeof(xfs_bmbt_key_t));

Should really be xfs_bmbt_copy_keys(), right?

> +     pp = xfs_bmbt_ptr_addr(cur, 1, block);
> +     cpp = xfs_bmbt_ptr_addr(cur, 1, cblock);
> +
> +#ifdef DEBUG
> +     for (i = 0; i < crecs; i++) {
> +             int     error;
> +
> +             error = xfs_btree_check_ptr(cur, cpp, i, level - 1);
> +             if (error) {
> +                     XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR);
> +                     return error;
> +             }
> +     }
> +#endif
> +
> +     memcpy(pp, cpp, nrecs * sizeof(xfs_bmbt_key_t));

xfs_bmbt_copy_recs()?

Otherwise looks ok.

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx


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