On Tue, Aug 05, 2008 at 11:43:06AM +1000, Dave Chinner wrote:
> On Mon, Aug 04, 2008 at 03:35:56AM +0200, Christoph Hellwig wrote:
> > Not really much reason to make it generic given that it's so small,
> > but this is the last non-method in xfs_alloc_btree.c and xfs_ialloc_btree.c,
> > so it makes the whole btree implementation more structured.
> ....
> > +int /* error */
> > +xfs_btree_getrec(
> > + struct xfs_btree_cur *cur, /* btree cursor */
> > + union xfs_btree_rec **recp, /* output: btree record */
> > + int *stat) /* output: success/failure */
> > +{
> > + struct xfs_btree_block *block; /* btree block */
> > + int ptr; /* record number */
> > +#ifdef DEBUG
> > + int error; /* error return value */
> > +#endif
> > +
> > + ptr = cur->bc_ptrs[0];
> > + block = XFS_BUF_TO_BLOCK(cur->bc_bufs[0]);
>
> Would it make more sense to use:
>
> block = xfs_btree_get_block(cur, 0, &bp);
>
> > +
> > +#ifdef DEBUG
> > + error = xfs_btree_check_block(cur, block, 0, cur->bc_bufs[0]);
>
> and then pass bp here? I'd rather use the helpers to do this than
> open code it like everything else does....
Thanks, updated.
|