xfs
[Top] [All Lists]

Re: [PATCH 11/21] implement generic xfs_btree_lookup

To: Christoph Hellwig <hch@xxxxxx>, xfs@xxxxxxxxxxx
Subject: Re: [PATCH 11/21] implement generic xfs_btree_lookup
From: Christoph Hellwig <hch@xxxxxx>
Date: Fri, 1 Aug 2008 21:43:36 +0200
In-reply-to: <20080730045937.GL13395@disturbed>
References: <20080729193104.GL19104@xxxxxx> <20080730045937.GL13395@disturbed>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
On Wed, Jul 30, 2008 at 02:59:37PM +1000, Dave Chinner wrote:
> > +   if (level == 0) {
> > +           union xfs_btree_rec     *krp;
> > +
> > +           krp = cur->bc_ops->rec_addr(cur, keyno, block);
> > +           cur->bc_ops->init_key_from_rec(cur, kp, krp);
> > +           return kp;
> 
> I think the record pointer variable "krp" is confusing with "kp", the key
> pointer. It's a record pointer; 'rp' it should be.

Ok, fixed.

> Can you make the {} consistent here ant move the comment for the
> else? i.e.

Yeah, done.

> > +   /* Return if we succeeded or not. */
> > +   if (keyno == 0 || keyno > xfs_btree_get_numrecs(block))
> > +           *stat = 0;
> > +   else
> > +           *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0));
> 
> Can probably kill all the extra () in that.

I've turned this into an if else if else with the superflous
braces removed.

> > --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c   2008-07-15 17:46:52.000000000 
> > +0200
> > +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c        2008-07-15 17:51:41.000000000 
> > +0200
> > @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf
> >   */
> >  
> >  /*
> > + * Lookup the record equal to [bno, len] in the btree given by cur.
> > + */
> > +STATIC int                         /* error */
> > +xfs_alloc_lookup_eq(
> 
> Should these be xfs_allocbt_lookup_*() to be consistent
> with all the other allocbt functions (and inobt_lookup/bmbt_lookup)?

Currently only the btree_ops methods are named allocbt.  Comments on
that scheme would be appreciated.


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