From 43eb5f2975848743e5b14c5bef20f40d404a7a04 Mon Sep 17 00:00:00 2001 From: Qu Wenruo Date: Fri, 1 Mar 2019 10:47:59 +0800 Subject: btrfs: Introduce extent_io_tree::owner to distinguish different io_trees Btrfs has the following different extent_io_trees used: - fs_info::free_extents[2] - btrfs_inode::io_tree - for both normal inodes and the btree inode - btrfs_inode::io_failure_tree - btrfs_transaction::dirty_pages - btrfs_root::dirty_log_pages If we want to trace changes in those trees, it will be pretty hard to distinguish them. Instead of using hard-to-read pointer address, this patch will introduce a new member extent_io_tree::owner to track the owner. This modification needs all the callers of extent_io_tree_init() to accept a new parameter @owner. This patch provides the basis for later trace events. Signed-off-by: Qu Wenruo Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/extent_io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/btrfs/extent_io.c') diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 139f2fe3092f..cfd2b237fd66 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -233,7 +233,8 @@ void __cold extent_io_exit(void) } void extent_io_tree_init(struct btrfs_fs_info *fs_info, - struct extent_io_tree *tree, void *private_data) + struct extent_io_tree *tree, unsigned int owner, + void *private_data) { tree->fs_info = fs_info; tree->state = RB_ROOT; @@ -241,6 +242,7 @@ void extent_io_tree_init(struct btrfs_fs_info *fs_info, tree->dirty_bytes = 0; spin_lock_init(&tree->lock); tree->private_data = private_data; + tree->owner = owner; } static struct extent_state *alloc_extent_state(gfp_t mask) -- cgit v1.2.3