summaryrefslogtreecommitdiff
path: root/include/trace
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2019-10-23 19:48:11 +0300
committerDavid Sterba <dsterba@suse.com>2019-11-18 19:51:44 +0300
commitbf38be65f3703d5ef3661c0a2802bc28e76b8f19 (patch)
tree3b1d7c392be5bde0fadd429c5024f1350de764ec /include/trace
parent34b127aecd4fe8e6a3903e10f204a7b7ffddca22 (diff)
downloadlinux-bf38be65f3703d5ef3661c0a2802bc28e76b8f19.tar.xz
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 'include/trace')
-rw-r--r--include/trace/events/btrfs.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 522d1f2b13e3..7b842b049ea3 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -716,8 +716,7 @@ TRACE_EVENT(btrfs_add_block_group,
__entry->offset = block_group->key.objectid;
__entry->size = block_group->key.offset;
__entry->flags = block_group->flags;
- __entry->bytes_used =
- btrfs_block_group_used(&block_group->item);
+ __entry->bytes_used = block_group->used;
__entry->bytes_super = block_group->bytes_super;
__entry->create = create;
),
@@ -1859,7 +1858,7 @@ DECLARE_EVENT_CLASS(btrfs__block_group,
TP_fast_assign_btrfs(bg_cache->fs_info,
__entry->bytenr = bg_cache->key.objectid,
__entry->len = bg_cache->key.offset,
- __entry->used = btrfs_block_group_used(&bg_cache->item);
+ __entry->used = bg_cache->used;
__entry->flags = bg_cache->flags;
),