Commit acbf1dd0 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: make ordered extent tracepoint take btrfs_inode

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: default avatarJosef Bacik <josef@toxicpanda.com>
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 6d072c8e
...@@ -217,7 +217,7 @@ static int __btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offset ...@@ -217,7 +217,7 @@ static int __btrfs_add_ordered_extent(struct btrfs_inode *inode, u64 file_offset
INIT_LIST_HEAD(&entry->work_list); INIT_LIST_HEAD(&entry->work_list);
init_completion(&entry->completion); init_completion(&entry->completion);
trace_btrfs_ordered_extent_add(&inode->vfs_inode, entry); trace_btrfs_ordered_extent_add(inode, entry);
spin_lock_irq(&tree->lock); spin_lock_irq(&tree->lock);
node = tree_insert(&tree->tree, file_offset, node = tree_insert(&tree->tree, file_offset,
...@@ -442,7 +442,7 @@ void btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry) ...@@ -442,7 +442,7 @@ void btrfs_put_ordered_extent(struct btrfs_ordered_extent *entry)
struct list_head *cur; struct list_head *cur;
struct btrfs_ordered_sum *sum; struct btrfs_ordered_sum *sum;
trace_btrfs_ordered_extent_put(entry->inode, entry); trace_btrfs_ordered_extent_put(BTRFS_I(entry->inode), entry);
if (refcount_dec_and_test(&entry->refs)) { if (refcount_dec_and_test(&entry->refs)) {
ASSERT(list_empty(&entry->root_extent_list)); ASSERT(list_empty(&entry->root_extent_list));
...@@ -528,7 +528,7 @@ void btrfs_remove_ordered_extent(struct inode *inode, ...@@ -528,7 +528,7 @@ void btrfs_remove_ordered_extent(struct inode *inode,
list_del_init(&entry->root_extent_list); list_del_init(&entry->root_extent_list);
root->nr_ordered_extents--; root->nr_ordered_extents--;
trace_btrfs_ordered_extent_remove(inode, entry); trace_btrfs_ordered_extent_remove(BTRFS_I(inode), entry);
if (!root->nr_ordered_extents) { if (!root->nr_ordered_extents) {
spin_lock(&fs_info->ordered_root_lock); spin_lock(&fs_info->ordered_root_lock);
...@@ -658,7 +658,7 @@ void btrfs_start_ordered_extent(struct inode *inode, ...@@ -658,7 +658,7 @@ void btrfs_start_ordered_extent(struct inode *inode,
u64 start = entry->file_offset; u64 start = entry->file_offset;
u64 end = start + entry->num_bytes - 1; u64 end = start + entry->num_bytes - 1;
trace_btrfs_ordered_extent_start(inode, entry); trace_btrfs_ordered_extent_start(BTRFS_I(inode), entry);
/* /*
* pages in the range can be dirty, clean or writeback. We * pages in the range can be dirty, clean or writeback. We
......
...@@ -510,7 +510,7 @@ DEFINE_EVENT( ...@@ -510,7 +510,7 @@ DEFINE_EVENT(
DECLARE_EVENT_CLASS(btrfs__ordered_extent, DECLARE_EVENT_CLASS(btrfs__ordered_extent,
TP_PROTO(const struct inode *inode, TP_PROTO(const struct btrfs_inode *inode,
const struct btrfs_ordered_extent *ordered), const struct btrfs_ordered_extent *ordered),
TP_ARGS(inode, ordered), TP_ARGS(inode, ordered),
...@@ -529,8 +529,8 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, ...@@ -529,8 +529,8 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
__field( u64, truncated_len ) __field( u64, truncated_len )
), ),
TP_fast_assign_btrfs(btrfs_sb(inode->i_sb), TP_fast_assign_btrfs(inode->root->fs_info,
__entry->ino = btrfs_ino(BTRFS_I(inode)); __entry->ino = btrfs_ino(inode);
__entry->file_offset = ordered->file_offset; __entry->file_offset = ordered->file_offset;
__entry->start = ordered->disk_bytenr; __entry->start = ordered->disk_bytenr;
__entry->len = ordered->num_bytes; __entry->len = ordered->num_bytes;
...@@ -539,8 +539,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, ...@@ -539,8 +539,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
__entry->flags = ordered->flags; __entry->flags = ordered->flags;
__entry->compress_type = ordered->compress_type; __entry->compress_type = ordered->compress_type;
__entry->refs = refcount_read(&ordered->refs); __entry->refs = refcount_read(&ordered->refs);
__entry->root_objectid = __entry->root_objectid = inode->root->root_key.objectid;
BTRFS_I(inode)->root->root_key.objectid;
__entry->truncated_len = ordered->truncated_len; __entry->truncated_len = ordered->truncated_len;
), ),
...@@ -563,7 +562,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent, ...@@ -563,7 +562,7 @@ DECLARE_EVENT_CLASS(btrfs__ordered_extent,
DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add, DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
TP_PROTO(const struct inode *inode, TP_PROTO(const struct btrfs_inode *inode,
const struct btrfs_ordered_extent *ordered), const struct btrfs_ordered_extent *ordered),
TP_ARGS(inode, ordered) TP_ARGS(inode, ordered)
...@@ -571,7 +570,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add, ...@@ -571,7 +570,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_add,
DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove, DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
TP_PROTO(const struct inode *inode, TP_PROTO(const struct btrfs_inode *inode,
const struct btrfs_ordered_extent *ordered), const struct btrfs_ordered_extent *ordered),
TP_ARGS(inode, ordered) TP_ARGS(inode, ordered)
...@@ -579,7 +578,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove, ...@@ -579,7 +578,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_remove,
DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start, DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
TP_PROTO(const struct inode *inode, TP_PROTO(const struct btrfs_inode *inode,
const struct btrfs_ordered_extent *ordered), const struct btrfs_ordered_extent *ordered),
TP_ARGS(inode, ordered) TP_ARGS(inode, ordered)
...@@ -587,7 +586,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start, ...@@ -587,7 +586,7 @@ DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_start,
DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put, DEFINE_EVENT(btrfs__ordered_extent, btrfs_ordered_extent_put,
TP_PROTO(const struct inode *inode, TP_PROTO(const struct btrfs_inode *inode,
const struct btrfs_ordered_extent *ordered), const struct btrfs_ordered_extent *ordered),
TP_ARGS(inode, ordered) TP_ARGS(inode, ordered)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment