btrfs: reduce type width of btrfs_io_contexts
authorQu Wenruo <wqu@suse.com>
Tue, 7 Feb 2023 04:26:13 +0000 (12:26 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Apr 2023 16:01:14 +0000 (18:01 +0200)
commit4ced85f81a7a67e190a4ff4e14d8cc04978a3767
tree998d8a705b43d03ff29ceb975806a2f32ebdb004
parentbe5c7edbfdf1112cbbdd15700f33f37b66fc8976
btrfs: reduce type width of btrfs_io_contexts

That structure is our ultimate object for all __btrfs_map_block()
related functions.  We have some hard to understand members, like
tgtdev_map, but without any comments.

This patch will improve the situation:

- Add extra comments for num_stripes, mirror_num, num_tgtdevs and
  tgtdev_map[]
  Especially for the last two members, add a dedicated (thus very long)
  comments for them, with example to explain it.

- Shrink those int members to u16.
  In fact our on-disk format is only using u16 for num_stripes, thus
  no need to use int at all.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/volumes.c
fs/btrfs/volumes.h