aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/sysfs.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2019-10-23 18:48:11 +0200
committerDavid Sterba <dsterba@suse.com>2019-11-18 17:51:44 +0100
commitbf38be65f3703d5ef3661c0a2802bc28e76b8f19 (patch)
tree3b1d7c392be5bde0fadd429c5024f1350de764ec /fs/btrfs/sysfs.c
parentbtrfs: Remove btrfs_bio::flags member (diff)
downloadlinux-dev-bf38be65f3703d5ef3661c0a2802bc28e76b8f19.tar.xz
linux-dev-bf38be65f3703d5ef3661c0a2802bc28e76b8f19.zip
btrfs: move block_group_item::used to block group
For unknown reasons, the member 'used' in the block group struct is stored in the b-tree item and accessed everywhere using the special accessor helper. Let's unify it and make it a regular member and only update the item before writing it to the tree. The item is still being used for flags and chunk_objectid, there's some duplication until the item is removed in following patches. 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/sysfs.c')
-rw-r--r--fs/btrfs/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index 98979dd048a8..8e2763380e56 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -404,7 +404,7 @@ static ssize_t raid_bytes_show(struct kobject *kobj,
if (&attr->attr == BTRFS_ATTR_PTR(raid, total_bytes))
val += block_group->key.offset;
else
- val += btrfs_block_group_used(&block_group->item);
+ val += block_group->used;
}
up_read(&sinfo->groups_sem);
return snprintf(buf, PAGE_SIZE, "%llu\n", val);