diff options
author | Qu Wenruo <quwenruo@cn.fujitsu.com> | 2015-09-28 16:57:53 +0800 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2015-10-21 18:41:08 -0700 |
commit | 81fb6f77a02678ddb0755c24f83c4ed5207da046 (patch) | |
tree | 751927a8dcfbdff1aee42368b0b5fc7941446d10 /fs/btrfs/qgroup.c | |
parent | b9d0b38928e21560550bd3c1a278d6e004d3bde6 (diff) | |
download | op-kernel-dev-81fb6f77a02678ddb0755c24f83c4ed5207da046.zip op-kernel-dev-81fb6f77a02678ddb0755c24f83c4ed5207da046.tar.gz |
btrfs: qgroup: Add new trace point for qgroup data reserve
Now each qgroup reserve for data will has its ftrace event for better
debugging.
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/qgroup.c')
-rw-r--r-- | fs/btrfs/qgroup.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 7d5339d..879343c 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -2516,10 +2516,12 @@ int btrfs_qgroup_reserve_data(struct inode *inode, u64 start, u64 len) changeset.bytes_changed = 0; changeset.range_changed = ulist_alloc(GFP_NOFS); - ret = set_record_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len -1, EXTENT_QGROUP_RESERVED, GFP_NOFS, &changeset); + trace_btrfs_qgroup_reserve_data(inode, start, len, + changeset.bytes_changed, + QGROUP_RESERVE); if (ret < 0) goto cleanup; ret = qgroup_reserve(root, changeset.bytes_changed); @@ -2544,6 +2546,7 @@ static int __btrfs_qgroup_release_data(struct inode *inode, u64 start, u64 len, int free) { struct extent_changeset changeset; + int trace_op = QGROUP_RELEASE; int ret; changeset.bytes_changed = 0; @@ -2557,8 +2560,12 @@ static int __btrfs_qgroup_release_data(struct inode *inode, u64 start, u64 len, if (ret < 0) goto out; - if (free) + if (free) { qgroup_free(BTRFS_I(inode)->root, changeset.bytes_changed); + trace_op = QGROUP_FREE; + } + trace_btrfs_qgroup_release_data(inode, start, len, + changeset.bytes_changed, trace_op); out: ulist_free(changeset.range_changed); return ret; |