Skip to contentSkip to conversation

btrfs: removed unused variable length in btrfs_insert_one_raid_extent

PATCH In review Johannes Thumshirn 2 participants 2 messages Dec 12, 2024 – Dec 13, 2024 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: removed unused variable length in btrfs_insert_one_raid_extent

From: Johannes Thumshirn <[email protected]>

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

---
 fs/btrfs/raid-stripe-tree.c | 4 ----
 1 file changed, 4 deletions(-)
fs/btrfs/raid-stripe-tree.c +0 -4
index 9ffc79f250fb..45b823a0913a 100644
@@ -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);
 	}
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Johannes Thumshirn

From: Johannes Thumshirn <[email protected]>

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

Looks good, thanks.

Quoted 25 lines
---
 fs/btrfs/raid-stripe-tree.c | 4 ----
 1 file changed, 4 deletions(-)
fs/btrfs/raid-stripe-tree.c +0 -5
index 9ffc79f250fb..45b823a0913a 100644
@@ -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