All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org, bfoster@redhat.com, hch@lst.de
Subject: Re: [PATCH 2/2] xfs: refactor xfs_iread_extents to use xfs_btree_visit_blocks
Date: Tue, 29 Oct 2019 07:28:40 +0100	[thread overview]
Message-ID: <20191029062840.GB17004@lst.de> (raw)
In-Reply-To: <157232186801.594704.5915391485002020723.stgit@magnolia>

On Mon, Oct 28, 2019 at 09:04:28PM -0700, Darrick J. Wong wrote:
> @@ -4313,6 +4314,11 @@ xfs_btree_visit_blocks(
>  			xfs_btree_copy_ptrs(cur, &lptr, ptr, 1);

>  
> +		/* Skip whatever we don't want. */
> +		if ((level == 0 && !(flags & XFS_BTREE_VISIT_RECORDS)) ||
> +		    (level > 0 && !(flags & XFS_BTREE_VISIT_LEAVES)))
> +			continue;

Nipick:  I'd make this two separate if statements as that flows a little
easier.  In fact the closing brace above is the start of a level > 0
check, so the whole thing could become:

		if (level > 0) {
			// existing code, maybe also move the comment above
			// the if here

			if (!(flags & XFS_BTREE_VISIT_RECORDS))
				continue;
		} else {
			if (!(flags & XFS_BTREE_VISIT_LEAVES))
				continue;
		}

which would be even nicer.  Otherwise this patch looks fine to me:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2019-10-29  6:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  4:04 [PATCH v2 0/2] xfs: refactor open-coded bmbt walks Darrick J. Wong
2019-10-29  4:04 ` [PATCH 1/2] xfs: refactor xfs_bmap_count_blocks using newer btree helpers Darrick J. Wong
2019-10-29  6:24   ` Christoph Hellwig
2019-10-29  4:04 ` [PATCH 2/2] xfs: refactor xfs_iread_extents to use xfs_btree_visit_blocks Darrick J. Wong
2019-10-29  6:28   ` Christoph Hellwig [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-10-25  5:15 [PATCH 0/2] xfs: refactor open-coded bmbt walks Darrick J. Wong
2019-10-25  5:15 ` [PATCH 2/2] xfs: refactor xfs_iread_extents to use xfs_btree_visit_blocks Darrick J. Wong
2019-10-25 12:53   ` Christoph Hellwig
2019-10-25 17:25     ` Darrick J. Wong

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=20191029062840.GB17004@lst.de \
    --to=hch@lst.de \
    --cc=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.