diff options
author | David Sterba <dsterba@suse.com> | 2019-10-23 18:48:22 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-11-18 17:51:45 +0100 |
commit | b3470b5dbe1300dea94191ae4b7d070be9a5cdc9 (patch) | |
tree | 6afcb7969d6cb3c7f041da9eac5c3772d8470412 /fs/btrfs/reada.c | |
parent | btrfs: rename extent buffer block group item accessors (diff) | |
download | linux-b3470b5dbe1300dea94191ae4b7d070be9a5cdc9.tar.xz linux-b3470b5dbe1300dea94191ae4b7d070be9a5cdc9.zip |
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>
Diffstat (limited to 'fs/btrfs/reada.c')
-rw-r--r-- | fs/btrfs/reada.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/reada.c b/fs/btrfs/reada.c index 1feaeadc8cf5..907c5d79a197 100644 --- a/fs/btrfs/reada.c +++ b/fs/btrfs/reada.c @@ -248,8 +248,8 @@ static struct reada_zone *reada_find_zone(struct btrfs_device *dev, u64 logical, if (!cache) return NULL; - start = cache->key.objectid; - end = start + cache->key.offset - 1; + start = cache->start; + end = start + cache->length - 1; btrfs_put_block_group(cache); zone = kzalloc(sizeof(*zone), GFP_KERNEL); |