All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 1/2] xfs: refactor xfs_bmap_count_blocks using newer btree helpers
Date: Fri, 25 Oct 2019 05:40:28 -0700	[thread overview]
Message-ID: <20191025124028.GA16251@infradead.org> (raw)
In-Reply-To: <157198052157.2873576.11427854428031607748.stgit@magnolia>

> +		error = xfs_btree_count_blocks(cur, &btblocks);
> +		xfs_btree_del_cursor(cur, error);
> +		if (error)
> +			return error;
> +
> +		*count += btblocks - 1;

Can you throw in a comment explaining the -1 here?  Without doing
extra research I can't think of a reason why it would be there.

> +		/* fall through */
> +	case XFS_DINODE_FMT_EXTENTS:
> +		*nextents = xfs_bmap_count_leaves(ifp, count);
>  		return 0;

I don't think you need the return statement here as there is a return 0
just below it.

  reply	other threads:[~2019-10-25 12:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-25  5:15 [PATCH 0/2] xfs: refactor open-coded bmbt walks Darrick J. Wong
2019-10-25  5:15 ` [PATCH 1/2] xfs: refactor xfs_bmap_count_blocks using newer btree helpers Darrick J. Wong
2019-10-25 12:40   ` Christoph Hellwig [this message]
2019-10-25 17:21     ` 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
  -- strict thread matches above, loose matches on Subject: below --
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

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=20191025124028.GA16251@infradead.org \
    --to=hch@infradead.org \
    --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.