Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: Zhen Ni <zhen.ni@easystack.cn>, "clm@fb.com" <clm@fb.com>,
	"dsterba@suse.com" <dsterba@suse.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: remove redundant inode NULL check in is_data_bbio()
Date: Fri, 19 Dec 2025 12:56:35 +0000	[thread overview]
Message-ID: <0d6b1fe4-00d1-4fac-a1ed-e4a545a94adf@wdc.com> (raw)
In-Reply-To: <20251219084316.1164580-1-zhen.ni@easystack.cn>

On 12/19/25 9:43 AM, Zhen Ni wrote:
> After commit 81cea6cd7041 ("btrfs: remove btrfs_bio::fs_info by
> extracting it from btrfs_bio::inode"), the btrfs_bio::inode field is
> mandatory for all btrfs_bio allocations. The NULL check is redundant and
> can be removed.
>
> Signed-off-by: Zhen Ni <zhen.ni@easystack.cn>
> ---
>   fs/btrfs/bio.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/btrfs/bio.c b/fs/btrfs/bio.c
> index fa1d321a2fb8..ce649e265b75 100644
> --- a/fs/btrfs/bio.c
> +++ b/fs/btrfs/bio.c
> @@ -29,7 +29,7 @@ struct btrfs_failed_bio {
>   /* Is this a data path I/O that needs storage layer checksum and repair? */
>   static inline bool is_datais_data_bbio
> _bbio(const struct btrfs_bio *bbio)
>   {
> -	return bbio->inode && is_data_inode(bbio->inode);
> +	return is_data_inode(bbio->inode);
>   }
>   
>   static bool bbio_has_ordered_extent(const struct btrfs_bio *bbio)

But then is_data_bbio() becomes a simple wrapper around is_data_inode() 
not adding any functionality or documentation. I'd think you scan just 
replace is_data_bbio(bbio) with is_data_inode(bbio->inode) in all of bio.c



      reply	other threads:[~2025-12-19 12:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-19  8:43 [PATCH] btrfs: remove redundant inode NULL check in is_data_bbio() Zhen Ni
2025-12-19 12:56 ` Johannes Thumshirn [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=0d6b1fe4-00d1-4fac-a1ed-e4a545a94adf@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=zhen.ni@easystack.cn \
    /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