summaryrefslogtreecommitdiff
path: root/fs/btrfs/block-group.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2023-11-21 16:38:39 +0300
committerDavid Sterba <dsterba@suse.com>2023-12-15 22:27:02 +0300
commit71fca47b644910485c49d1da31bc963cf286fe77 (patch)
tree2369b3cde53f7bfd547283224b2e4e0e7c097264 /fs/btrfs/block-group.c
parent7dc66abb5a47778d7db327783a0ba172b8cff0b5 (diff)
downloadlinux-71fca47b644910485c49d1da31bc963cf286fe77.tar.xz
btrfs: remove stripe size local variable from insert_dev_extents()
It's not needed to have a local variable to store the stripe size at insert_dev_extents(), we can just take from the chunk map as it's only used once and typing 'map->stripe_size' is not much more verbose than simply typing 'stripe_size'. So remove the local variable. This was added before the recent addition of a dedicated structure for chunk mappings because the stripe size was encoded in the 'orig_block_len' field of an extent_map structure, so the use of the local variable made things more readable. Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-group.c')
-rw-r--r--fs/btrfs/block-group.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c
index 0fea258eea15..4365f7b6b94d 100644
--- a/fs/btrfs/block-group.c
+++ b/fs/btrfs/block-group.c
@@ -2597,7 +2597,6 @@ static int insert_dev_extents(struct btrfs_trans_handle *trans,
struct btrfs_device *device;
struct btrfs_chunk_map *map;
u64 dev_offset;
- u64 stripe_size;
int i;
int ret = 0;
@@ -2605,8 +2604,6 @@ static int insert_dev_extents(struct btrfs_trans_handle *trans,
if (IS_ERR(map))
return PTR_ERR(map);
- stripe_size = map->stripe_size;
-
/*
* Take the device list mutex to prevent races with the final phase of
* a device replace operation that replaces the device object associated
@@ -2622,7 +2619,7 @@ static int insert_dev_extents(struct btrfs_trans_handle *trans,
dev_offset = map->stripes[i].physical;
ret = insert_dev_extent(trans, device, chunk_offset, dev_offset,
- stripe_size);
+ map->stripe_size);
if (ret)
break;
}