From: Dave Chinner <david@fromorbit.com>
To: Christoph Hellwig <hch@lst.de>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 24/26] implement generic xfs_btree_getrec
Date: Tue, 5 Aug 2008 11:43:06 +1000 [thread overview]
Message-ID: <20080805014306.GO6119@disturbed> (raw)
In-Reply-To: <20080804013556.GY8819@lst.de>
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....
Otherwise it looks good.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2008-08-05 1:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-04 1:35 [PATCH 24/26] implement generic xfs_btree_getrec Christoph Hellwig
2008-08-05 1:43 ` Dave Chinner [this message]
2008-08-05 1:47 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080805014306.GO6119@disturbed \
--to=david@fromorbit.com \
--cc=hch@lst.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox