diff mbox series

btrfs: removed unused variable length in btrfs_insert_one_raid_extent

Message ID eeb2f4fd6565f76ddce9e8af725bd613e9b50e19.1734008129.git.jth@kernel.org (mailing list archive)
State New
Headers show
Series btrfs: removed unused variable length in btrfs_insert_one_raid_extent | expand

Commit Message

Johannes Thumshirn Dec. 12, 2024, 12:56 p.m. UTC
From: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Remove the variable length in btrfs_insert_one_raid_extent() as it is
unused.

Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
---
 fs/btrfs/raid-stripe-tree.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Filipe Manana Dec. 13, 2024, 12:12 p.m. UTC | #1
On Thu, Dec 12, 2024 at 12:56 PM Johannes Thumshirn <jth@kernel.org> wrote:
>
> From: Johannes Thumshirn <johannes.thumshirn@wdc.com>
>
> Remove the variable length in btrfs_insert_one_raid_extent() as it is
> unused.
>
> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>

Reviewed-by: Filipe Manana <fdmanana@suse.com>

Looks good, thanks.

> ---
>  fs/btrfs/raid-stripe-tree.c | 4 ----
>  1 file changed, 4 deletions(-)
>
> diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c
> index 9ffc79f250fb..45b823a0913a 100644
> --- a/fs/btrfs/raid-stripe-tree.c
> +++ b/fs/btrfs/raid-stripe-tree.c
> @@ -199,12 +199,8 @@ int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans,
>         for (int i = 0; i < num_stripes; i++) {
>                 u64 devid = bioc->stripes[i].dev->devid;
>                 u64 physical = bioc->stripes[i].physical;
> -               u64 length = bioc->stripes[i].length;
>                 struct btrfs_raid_stride *raid_stride = &stripe_extent->strides[i];
>
> -               if (length == 0)
> -                       length = bioc->size;
> -
>                 btrfs_set_stack_raid_stride_devid(raid_stride, devid);
>                 btrfs_set_stack_raid_stride_physical(raid_stride, physical);
>         }
> --
> 2.43.0
>
>
diff mbox series

Patch

diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c
index 9ffc79f250fb..45b823a0913a 100644
--- a/fs/btrfs/raid-stripe-tree.c
+++ b/fs/btrfs/raid-stripe-tree.c
@@ -199,12 +199,8 @@  int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans,
 	for (int i = 0; i < num_stripes; i++) {
 		u64 devid = bioc->stripes[i].dev->devid;
 		u64 physical = bioc->stripes[i].physical;
-		u64 length = bioc->stripes[i].length;
 		struct btrfs_raid_stride *raid_stride = &stripe_extent->strides[i];
 
-		if (length == 0)
-			length = bioc->size;
-
 		btrfs_set_stack_raid_stride_devid(raid_stride, devid);
 		btrfs_set_stack_raid_stride_physical(raid_stride, physical);
 	}