]> 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)
committerQu Wenruo <wqu@suse.com>
Wed, 21 Oct 2026 22:42:42 +0000 (09:12 +1030)
commit7d98a4efce8a5778fa3f860eac29815c5409e906
tree0312c34c6e51e7fb5ae74b0e34ba787c5fb81a91
parent20a562a933f70aea66d06f0d7e03054f328989f7
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>
fs/btrfs/volumes.h