On Wed, Jul 12, 2006 at 10:49:21AM +1000, Nathan Scott wrote:
> 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?
Right, it should be pp[i], I'll resping the patch. I wonder why I
didn't get any warning from the compiler, though as I'm always building
with DEBUG enabled.
> > --- 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*.
It's converted a patch or two later in the series. This patch only
introduced the helper, the switch to be64_to_cpu() happens when the
variables it's operating on are switched to the __be64 so we don't
get sparse warnings and can verify the annotations better.
|