btrfs: get fs_info from block group in load_free_space_cache
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 12:47:15 +0000 (13:47 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:45 +0000 (19:02 +0200)
We can read fs_info from the block group cache structure and can drop it
from the parameters.

Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent-tree.c
fs/btrfs/free-space-cache.c
fs/btrfs/free-space-cache.h

index e881c20b975afa3dfe0ffd8f3358309942b42895..3706984776274253a3c6c1e53ac61147ea156f96 100644 (file)
@@ -643,7 +643,7 @@ static int cache_block_group(struct btrfs_block_group_cache *cache,
 
        if (btrfs_test_opt(fs_info, SPACE_CACHE)) {
                mutex_lock(&caching_ctl->mutex);
-               ret = load_free_space_cache(fs_info, cache);
+               ret = load_free_space_cache(cache);
 
                spin_lock(&cache->lock);
                if (ret == 1) {
index f30c1bc1dced826d667acbf0b740d35a1615f2ad..98ebe4b28f299a00a9176618f05375e0baeeec25 100644 (file)
@@ -812,9 +812,9 @@ free_cache:
        goto out;
 }
 
-int load_free_space_cache(struct btrfs_fs_info *fs_info,
-                         struct btrfs_block_group_cache *block_group)
+int load_free_space_cache(struct btrfs_block_group_cache *block_group)
 {
+       struct btrfs_fs_info *fs_info = block_group->fs_info;
        struct btrfs_free_space_ctl *ctl = block_group->free_space_ctl;
        struct inode *inode;
        struct btrfs_path *path;
index ab387c219bb0f4a3c106cd3c780b74febd41777f..9067841a8528022c110ba3114195d192b062b33e 100644 (file)
@@ -50,8 +50,7 @@ int btrfs_check_trunc_cache_free_space(struct btrfs_fs_info *fs_info,
 int btrfs_truncate_free_space_cache(struct btrfs_trans_handle *trans,
                                    struct btrfs_block_group_cache *block_group,
                                    struct inode *inode);
-int load_free_space_cache(struct btrfs_fs_info *fs_info,
-                         struct btrfs_block_group_cache *block_group);
+int load_free_space_cache(struct btrfs_block_group_cache *block_group);
 int btrfs_wait_cache_io(struct btrfs_trans_handle *trans,
                        struct btrfs_block_group_cache *block_group,
                        struct btrfs_path *path);