]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: add dedicated members for start and length of a block group
authorDavid Sterba <dsterba@suse.com>
Wed, 23 Oct 2019 16:48:22 +0000 (18:48 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 18 Nov 2019 16:51:45 +0000 (17:51 +0100)
commit937467962e0e9afcc9ec4620cef0288e262abbcd
tree6afcb7969d6cb3c7f041da9eac5c3772d8470412
parent6f239094ae0ea89d4a6c171b680cb457d5235fff
btrfs: add dedicated members for start and length of a block group

The on-disk format of block group item makes use of the key that stores
the offset and length. This is further used in the code, although this
makes thing harder to understand. The key is also packed so the
offset/length is not properly aligned as u64.

Add start (key.objectid) and length (key.offset) members to block group
and remove the embedded key.  When the item is searched or written, a
local variable for key is used.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
15 files changed:
fs/btrfs/block-group.c
fs/btrfs/block-group.h
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-tree.c
fs/btrfs/ioctl.c
fs/btrfs/reada.c
fs/btrfs/relocation.c
fs/btrfs/scrub.c
fs/btrfs/space-info.c
fs/btrfs/sysfs.c
fs/btrfs/tests/btrfs-tests.c
fs/btrfs/tests/free-space-tree-tests.c
fs/btrfs/volumes.c
include/trace/events/btrfs.h