OSDN Git Service

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)
commitb3470b5dbe1300dea94191ae4b7d070be9a5cdc9
tree6afcb7969d6cb3c7f041da9eac5c3772d8470412
parent0222dfdd4af1be2e70db956db61f9b43386ab76b
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