diff options
author | Qu Wenruo <wqu@suse.com> | 2020-03-05 08:54:11 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2020-05-25 12:25:17 +0300 |
commit | 33a0f1f716973ae87d94e03e597d0c46fd032541 (patch) | |
tree | 5f3ac55eb08a69f2c544ec912b425b1fc3021c57 /fs/btrfs/relocation.c | |
parent | 84780289335fe614057e5ddf796050ce15751f4a (diff) | |
download | linux-33a0f1f716973ae87d94e03e597d0c46fd032541.tar.xz |
btrfs: reloc: add backref_cache::fs_info member
Add this member so that we can grab fs_info without the help from
reloc_control.
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 39294c595c66..0833cfa82da9 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -164,6 +164,8 @@ struct backref_cache { /* The list of useless backref nodes during backref cache build */ struct list_head useless_node; + + struct btrfs_fs_info *fs_info; }; /* @@ -266,7 +268,8 @@ static void mapping_tree_init(struct mapping_tree *tree) spin_lock_init(&tree->lock); } -static void backref_cache_init(struct backref_cache *cache) +static void backref_cache_init(struct btrfs_fs_info *fs_info, + struct backref_cache *cache) { int i; cache->rb_root = RB_ROOT; @@ -277,6 +280,7 @@ static void backref_cache_init(struct backref_cache *cache) INIT_LIST_HEAD(&cache->leaves); INIT_LIST_HEAD(&cache->pending_edge); INIT_LIST_HEAD(&cache->useless_node); + cache->fs_info = fs_info; } static void backref_cache_cleanup(struct backref_cache *cache) @@ -4188,7 +4192,7 @@ static struct reloc_control *alloc_reloc_control(struct btrfs_fs_info *fs_info) INIT_LIST_HEAD(&rc->reloc_roots); INIT_LIST_HEAD(&rc->dirty_subvol_roots); - backref_cache_init(&rc->backref_cache); + backref_cache_init(fs_info, &rc->backref_cache); mapping_tree_init(&rc->reloc_root_tree); extent_io_tree_init(fs_info, &rc->processed_blocks, IO_TREE_RELOC_BLOCKS, NULL); |