btrfs: get fs_info from trans in create_free_space_inode
authorDavid Sterba <dsterba@suse.com>
Wed, 20 Mar 2019 12:42:57 +0000 (13:42 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:41 +0000 (19:02 +0200)
We can read fs_info from the transaction 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 174f4f0311dacb49836cb919e60e1aa65fc98050..931f7d92136395c3a1ce63a16673a9048b8b5ac2 100644 (file)
@@ -3411,8 +3411,7 @@ again:
                if (block_group->ro)
                        goto out_free;
 
-               ret = create_free_space_inode(fs_info, trans, block_group,
-                                             path);
+               ret = create_free_space_inode(trans, block_group, path);
                if (ret)
                        goto out_free;
                goto again;
index 207fb50dcc7aa9b051ff161156b3b9e0359a65b7..dc1151aebf3d168a6146b17d85dcda0485d08676 100644 (file)
@@ -185,20 +185,19 @@ static int __create_free_space_inode(struct btrfs_root *root,
        return 0;
 }
 
-int create_free_space_inode(struct btrfs_fs_info *fs_info,
-                           struct btrfs_trans_handle *trans,
+int create_free_space_inode(struct btrfs_trans_handle *trans,
                            struct btrfs_block_group_cache *block_group,
                            struct btrfs_path *path)
 {
        int ret;
        u64 ino;
 
-       ret = btrfs_find_free_objectid(fs_info->tree_root, &ino);
+       ret = btrfs_find_free_objectid(trans->fs_info->tree_root, &ino);
        if (ret < 0)
                return ret;
 
-       return __create_free_space_inode(fs_info->tree_root, trans, path, ino,
-                                        block_group->key.objectid);
+       return __create_free_space_inode(trans->fs_info->tree_root, trans, path,
+                                        ino, block_group->key.objectid);
 }
 
 int btrfs_check_trunc_cache_free_space(struct btrfs_fs_info *fs_info,
index 15e30b93db0d82e4d03c27d8713ad77aefd35af5..4f0d26ccfde690667c7836061009eed285fafe46 100644 (file)
@@ -41,8 +41,7 @@ struct btrfs_io_ctl;
 struct inode *lookup_free_space_inode(struct btrfs_fs_info *fs_info,
                                      struct btrfs_block_group_cache
                                      *block_group, struct btrfs_path *path);
-int create_free_space_inode(struct btrfs_fs_info *fs_info,
-                           struct btrfs_trans_handle *trans,
+int create_free_space_inode(struct btrfs_trans_handle *trans,
                            struct btrfs_block_group_cache *block_group,
                            struct btrfs_path *path);