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>
struct btrfs_chunk_map {
struct rb_node rb_node;
- /* For mount time dev extent verification. */
- int verified_stripes;
refcount_t refs;
+ u16 num_stripes;
+ u16 sub_stripes;
u64 start;
u64 chunk_len;
u64 dev_extent_size;
*/
u64 type;
u64 on_disk_type;
- int num_stripes;
- int sub_stripes;
+ /* For mount time dev extent verification. */
+ u16 verified_stripes;
struct btrfs_io_stripe stripes[];
};