summary refs log tree commit diff
path: root/lib/gen_crc32table.c
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2020-05-05 07:58:20 +0800
committerDavid Sterba <dsterba@suse.com>2020-05-25 11:25:30 +0200
commit9afc66498a0b5f76928f9823b58c55c5dfb06ae5 (patch)
tree4510aaec28a8faffbe622624a0caa4b55708928c /lib/gen_crc32table.c
parent83fe9e12b0558eae519351cff00da1e06bc054d2 (diff)
downloadlinux-9afc66498a0b5f76928f9823b58c55c5dfb06ae5.tar.gz
btrfs: block-group: refactor how we read one block group item
Structure btrfs_block_group has the following members which are
currently read from on-disk block group item and key:

- length - from item key
- used
- flags - from block group item

However for incoming skinny block group tree, we are going to read those
members from different sources.

This patch will refactor such read by:

- Don't initialize btrfs_block_group::length at allocation
  Caller should initialize them manually.
  Also to avoid possible (well, only two callers) missing
  initialization, add extra ASSERT() in btrfs_add_block_group_cache().

- Refactor length/used/flags initialization into one function
  The new function, fill_one_block_group() will handle the
  initialization of such members.

- Use btrfs_block_group::length to replace key::offset
  Since skinny block group item would have a different meaning for its
  key offset.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'lib/gen_crc32table.c')
0 files changed, 0 insertions, 0 deletions