From: Christoph Hellwig <hch@infradead.org>
To: Barry Naujok <bnaujok@sgi.com>
Cc: "xfs@oss.sgi.com" <xfs@oss.sgi.com>, xfs-dev <xfs-dev@sgi.com>
Subject: Re: [REVIEW] cleanup - refactor xfs_dir2_leafn_lookup_int()
Date: Wed, 9 Apr 2008 04:17:36 -0400 [thread overview]
Message-ID: <20080409081736.GA18976@infradead.org> (raw)
In-Reply-To: <op.t9b29ska3jf8g2@pc-bnaujok.melbourne.sgi.com>
On Wed, Apr 09, 2008 at 06:02:06PM +1000, Barry Naujok wrote:
> + if (curbp) {
> + /* For addname, giving back a free block. */
Given the function is only for addname anymore the first half of the
comment doesn't make sense anymore.
> + if (dep->namelen == args->namelen && memcmp(dep->name,
> + args->name, args->namelen) == 0) {
> + args->inumber = be64_to_cpu(dep->inumber);
> + *indexp = index;
> + state->extravalid = 1;
> + state->extrablk.bp = curbp;
> state->extrablk.blkno = curdb;
> + state->extrablk.index = (int)((char *)dep -
> + (char *)curbp->data);
> state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
> + return XFS_ERROR(EEXIST);
> }
> }
> /*
> + * Didn't find a match.
> + * If we are holding a buffer, give it back in case our caller
> + * finds it useful.
> + */
> + if (curbp) {
> + /* Giving back a data block. */
> + state->extravalid = 1;
> + state->extrablk.bp = curbp;
> + state->extrablk.index = -1;
> + state->extrablk.blkno = curdb;
> + state->extrablk.magic = XFS_DIR2_DATA_MAGIC;
Might be worth factoring these two out using a goto
Otherwise the patch looks good.
prev parent reply other threads:[~2008-04-09 8:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-09 8:02 [REVIEW] cleanup - refactor xfs_dir2_leafn_lookup_int() Barry Naujok
2008-04-09 8:17 ` Christoph Hellwig [this message]
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=20080409081736.GA18976@infradead.org \
--to=hch@infradead.org \
--cc=bnaujok@sgi.com \
--cc=xfs-dev@sgi.com \
--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