]> git.hungrycats.org Git - linux/commit
btrfs: reduce the width of num_stripes and sub_stripes
authorQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2026 03:39:35 +0000 (14:09 +1030)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:18 +0000 (21:36 +0100)
commitdb7cb7b6d9044ca4c3137ffda8055314d76e3608
tree9c573dfa6a75ed4465a1680c81be4a779a04aa4c
parente6168e8013195dcb4dd2d3f7a5993028c0628aa4
btrfs: reduce the width of num_stripes and sub_stripes

The on-disk btrfs_chunk structure uses u16 for both num_stripes and
sub_stripes, so there is no need to use "int" to represent them in
btrfs_chunk_map.

Follow the on-disk format to use u16 for those members, including
verified_stripes too.

And since verified_stripes is u16, it no longer completely fill the
hole between @refs and @start.
Instead use @num_stripes and @sub_stripes to fill the hole, and leave a 6
bytes hole between @verified_stripes and @stripes.

This doesn't save any space for btrfs_chunk_map, but leaves enough space
for future expansion.

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/volumes.h