]> git.hungrycats.org Git - linux/commit
btrfs: convert volumes.c and block-group.c to use map->stripe_len
authorQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2026 03:39:40 +0000 (14:09 +1030)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:18 +0000 (21:36 +0100)
commit8a13fc366acd07c58a72b0eaee2c1e38f9280cee
tree0095a01f900432919ccfb80990ee5fa4d035fe07
parenteee8a3ff327a46230419c712865e44d53ed57a1d
btrfs: convert volumes.c and block-group.c to use map->stripe_len

There are still some BTRFS_STRIPE_LEN usage remaining, but they are all
for chunk allocation.

There is one more refactor for is_same_chunk_map(), as there are more
members to compare, the parameter list can go longer and longer.

Instead of passing a new @stripe_len member, pass extent_buffer and
btrfs_chunk pointers, and grab the needed member inside that function.

And doing "if (unlikely()) return false" for each member check.

Although this make is_same_chunk_map() more complex, considering it's
only called for system chunks, it should not bring too much overhead.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c
fs/btrfs/volumes.c