diff options
author | Qu Wenruo <wqu@suse.com> | 2017-12-12 15:34:35 +0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-03-31 02:01:05 +0200 |
commit | 4ee0d8832c2ecd08fd4ccbaa55484e6a500f2f34 (patch) | |
tree | e9bb320db4632705a96dee98fc36640c4be3b0cd /fs/btrfs | |
parent | 8287475a20552af66b32c07704dbdbeeb898ac1f (diff) |
btrfs: qgroup: Update trace events for metadata reservation
Now trace_qgroup_meta_reserve() will have extra type parameter.
And introduce two new trace events:
1) trace_qgroup_meta_free_all_pertrans()
For btrfs_qgroup_free_meta_all_pertrans()
2) trace_qgroup_meta_convert()
For btrfs_qgroup_convert_reserved_meta()
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/qgroup.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 836819c34c95..92e2c9f15951 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -3138,7 +3138,7 @@ int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes, return 0; BUG_ON(num_bytes != round_down(num_bytes, fs_info->nodesize)); - trace_qgroup_meta_reserve(root, (s64)num_bytes); + trace_qgroup_meta_reserve(root, type, (s64)num_bytes); ret = qgroup_reserve(root, num_bytes, enforce, type); if (ret < 0) return ret; @@ -3163,7 +3163,7 @@ void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root) return; /* TODO: Update trace point to handle such free */ - trace_qgroup_meta_reserve(root, 0); + trace_qgroup_meta_free_all_pertrans(root); /* Special value -1 means to free all reserved space */ btrfs_qgroup_free_refroot(fs_info, root->objectid, (u64)-1, BTRFS_QGROUP_RSV_META_PERTRANS); @@ -3185,7 +3185,7 @@ void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes, */ num_bytes = sub_root_meta_rsv(root, num_bytes, type); BUG_ON(num_bytes != round_down(num_bytes, fs_info->nodesize)); - trace_qgroup_meta_reserve(root, -(s64)num_bytes); + trace_qgroup_meta_reserve(root, type, -(s64)num_bytes); btrfs_qgroup_free_refroot(fs_info, root->objectid, num_bytes, type); } @@ -3245,6 +3245,7 @@ void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes) /* Same as btrfs_qgroup_free_meta_prealloc() */ num_bytes = sub_root_meta_rsv(root, num_bytes, BTRFS_QGROUP_RSV_META_PREALLOC); + trace_qgroup_meta_convert(root, num_bytes); qgroup_convert_meta(fs_info, root->objectid, num_bytes); } |