public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Sun YangKai <sunk67188@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions
Date: Tue, 30 Sep 2025 18:35:47 +0200	[thread overview]
Message-ID: <20250930163547.GC4052@twin.jikos.cz> (raw)
In-Reply-To: <20250930050918.31029-2-sunk67188@gmail.com>

On Tue, Sep 30, 2025 at 01:09:07PM +0800, Sun YangKai wrote:
> Trivial pattern for the auto freeing without goto -> return conversions.
> No other function cleanup.
> 
> Tested with btrfs/auto group.
> 
> Signed-off-by: Sun YangKai <sunk67188@gmail.com>
> ---
>  fs/btrfs/uuid-tree.c | 12 ++++--------
>  fs/btrfs/verity.c    |  9 +++------
>  fs/btrfs/volumes.c   | 44 ++++++++++++++------------------------------
>  fs/btrfs/xattr.c     |  7 ++-----
>  4 files changed, 23 insertions(+), 49 deletions(-)
> 
> diff --git a/fs/btrfs/uuid-tree.c b/fs/btrfs/uuid-tree.c
> index 17b5e81123a1..30e5d80adda9 100644
> --- a/fs/btrfs/uuid-tree.c
> +++ b/fs/btrfs/uuid-tree.c
> @@ -27,7 +27,7 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, const u8 *uuid,
>  				  u8 type, u64 subid)
>  {
>  	int ret;
> -	struct btrfs_path *path = NULL;
> +	BTRFS_PATH_AUTO_FREE(path);
>  	struct extent_buffer *eb;
>  	int slot;
>  	u32 item_size;
> @@ -79,7 +79,6 @@ static int btrfs_uuid_tree_lookup(struct btrfs_root *uuid_root, const u8 *uuid,
>  	}
>  
>  out:
> -	btrfs_free_path(path);

Here and in several other places you did not convert gotos to returns
and removed the out: label. What I've seen in other places in the patch
the conversions are straightforward and you already did that in other
patches. Can you please do it here as well?

The unnecessary gotos are in functions where the patch auto freeing is
not done, this could be another cleanup round.

  reply	other threads:[~2025-09-30 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-30  5:09 [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions Sun YangKai
2025-09-30 16:35 ` David Sterba [this message]
2025-10-01 13:32   ` Sun YangKai
2025-10-02 13:39   ` [PATCH] btrfs: goto out -> return conversions for previous patch Sun YangKai
2025-10-02 15:56     ` David Sterba
2025-10-04 12:49       ` Sun YangKai
  -- strict thread matches above, loose matches on Subject: below --
2025-08-19  3:37 [PATCH] btrfs: more trivial BTRFS_PATH_AUTO_FREE conversions Sun YangKai
2025-08-21  8:21 ` Dan Carpenter
2025-08-21 10:19   ` Sun YangKai

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=20250930163547.GC4052@twin.jikos.cz \
    --to=dsterba@suse.cz \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=sunk67188@gmail.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