Linux XFS filesystem development
 help / color / mirror / Atom feed
From: Dave Chinner <dgc@kernel.org>
To: Eric Sandeen <sandeen@redhat.com>
Cc: linux-xfs@vger.kernel.org, cem@kernel.org, djwong@kernel.org, hch@lst.de
Subject: Re: [PATCH 5/5] xfs: remove status parameter from several btree insert functions
Date: Wed, 14 Oct 2026 14:59:19 +1100	[thread overview]
Message-ID: <as7-F3aJcKmqu3mO@dread> (raw)
In-Reply-To: <20261014013505.759089-6-sandeen@redhat.com>

On Tue, Oct 13, 2026 at 08:30:03PM -0500, Eric Sandeen wrote:
> xfs_btree_insert and its callers now have no need for the status
> parameter; either they return error = 0 / status = 1, or nonzero error
> and status 0. Every caller now handles the error and never reaches
> the duplicate status variable check. Remove the status params.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
> ---
>  fs/xfs/libxfs/xfs_alloc.c    | 10 +++++-----
>  fs/xfs/libxfs/xfs_bmap.c     | 22 +++++++++++-----------
>  fs/xfs/libxfs/xfs_btree.c    |  4 +---
>  fs/xfs/libxfs/xfs_btree.h    |  2 +-
>  fs/xfs/libxfs/xfs_ialloc.c   | 13 ++++++-------
>  fs/xfs/libxfs/xfs_ialloc.h   |  3 +--
>  fs/xfs/libxfs/xfs_refcount.c | 17 +++++++----------
>  fs/xfs/libxfs/xfs_refcount.h |  2 +-
>  fs/xfs/libxfs/xfs_rmap.c     | 14 +++++++-------
>  fs/xfs/scrub/rcbag.c         |  2 +-
>  fs/xfs/scrub/rcbag_btree.c   |  5 ++---
>  fs/xfs/scrub/rcbag_btree.h   |  3 +--
>  12 files changed, 44 insertions(+), 53 deletions(-)
> 
> diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c
> index b40c51a0f651..13a61144a2c8 100644
> --- a/fs/xfs/libxfs/xfs_alloc.c
> +++ b/fs/xfs/libxfs/xfs_alloc.c
> @@ -692,7 +692,7 @@ xfs_alloc_fixup_trees(
>  			xfs_btree_mark_sick(cnt_cur);
>  			return -EFSCORRUPTED;
>  		}
> -		if ((error = xfs_btree_insert(cnt_cur, &i)))
> +		if ((error = xfs_btree_insert(cnt_cur)))

While you are touching all of these, can you convert them to the
more common pattern of:

	error = xfs_btree_insert(cur);
	if (error)
		return error;

Otherwise the whole series looks good to me.

-Dave.
-- 
Dave Chinner
dgc@kernel.org

  reply	other threads:[~2026-10-14  3:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14  1:29 [PATCH RFC 0/5] xfs: Remove redundant btree insert code Eric Sandeen
2026-10-14  1:29 ` [PATCH 1/5] xfs: remove redundant stat checks after xfs_btree_insert() Eric Sandeen
2026-10-14  4:22   ` Eric Sandeen
2026-10-14  1:30 ` [PATCH 2/5] xfs: remove redundant stat checks after xfs_refcount_insert() Eric Sandeen
2026-10-14  1:30 ` [PATCH 3/5] xfs: remove redundant stat checks after xfs_inobt_insert_rec() Eric Sandeen
2026-10-14  1:30 ` [PATCH 4/5] xfs: remove redundant stat check after rcbagbt_insert() Eric Sandeen
2026-10-14  1:30 ` [PATCH 5/5] xfs: remove status parameter from several btree insert functions Eric Sandeen
2026-10-14  3:59   ` Dave Chinner [this message]
2026-10-14  4:07     ` Eric Sandeen
2026-10-14 13:21       ` 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=as7-F3aJcKmqu3mO@dread \
    --to=dgc@kernel.org \
    --cc=cem@kernel.org \
    --cc=djwong@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.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