public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Thumshirn <Johannes.Thumshirn@wdc.com>
To: David Sterba <dsterba@suse.com>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH] btrfs: remove unused btrfs_io_stripe::length
Date: Mon, 28 Apr 2025 14:49:39 +0000	[thread overview]
Message-ID: <dcb2e1d3-22ee-4d2d-b0b8-fe69296cb7a7@wdc.com> (raw)
In-Reply-To: <20250422153217.256995-1-dsterba@suse.com>

On 22.04.25 17:36, David Sterba wrote:
> First added (but not effectively used) in 02c372e1f016e5 ("btrfs: add
> support for inserting raid stripe extents"). The structure is
> initialized to zeros so the only use in btrfs_insert_one_raid_extent()
> 
>      u64 length = bioc->stripes[i].length;
>      struct btrfs_raid_stride *raid_stride = &stripe_extent->strides[i];
> 
>      if (length == 0)
>              length = bioc->size;
> 
> the 'if' always happens.
> 
> Last use in 4016358e852861 ("btrfs: remove unused variable length in
> btrfs_insert_one_raid_extent()") was an obvious cleanup. It seems to be
> safe to remove, raid-stripe-tree works without using it since 6.6.
> 
> This was found by tool https://github.com/jirislaby/clang-struct .
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>   fs/btrfs/volumes.h | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h
> index 0e793b9776d677..d06d2d8713f87f 100644
> --- a/fs/btrfs/volumes.h
> +++ b/fs/btrfs/volumes.h
> @@ -473,7 +473,6 @@ struct btrfs_io_stripe {
>   	struct btrfs_device *dev;
>   	/* Block mapping. */
>   	u64 physical;
> -	u64 length;
>   	bool rst_search_commit_root;
>   	/* For the endio handler. */
>   	struct btrfs_io_context *bioc;

Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

      reply	other threads:[~2025-04-28 14:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-22 15:32 [PATCH] btrfs: remove unused btrfs_io_stripe::length David Sterba
2025-04-28 14:49 ` 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=dcb2e1d3-22ee-4d2d-b0b8-fe69296cb7a7@wdc.com \
    --to=johannes.thumshirn@wdc.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox