btrfs: Remove fs_info from btrfs_add_root_ref
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>
Wed, 1 Aug 2018 03:32:29 +0000 (11:32 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 6 Aug 2018 11:13:00 +0000 (13:13 +0200)
It can be referenced from the passed transaction handle.

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/root-tree.c
fs/btrfs/transaction.c

index 3677082ddf4cedd0db66a3c947290ccc21edfe52..c275ea258f9a6b6617cb3c43738b748b84c9c329 100644 (file)
@@ -2984,10 +2984,9 @@ void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info,
 int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq);
 
 /* root-item.c */
-int btrfs_add_root_ref(struct btrfs_trans_handle *trans,
-                      struct btrfs_fs_info *fs_info,
-                      u64 root_id, u64 ref_id, u64 dirid, u64 sequence,
-                      const char *name, int name_len);
+int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
+                      u64 ref_id, u64 dirid, u64 sequence, const char *name,
+                      int name_len);
 int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
                       u64 ref_id, u64 dirid, u64 *sequence, const char *name,
                       int name_len);
index 7bf4a8d07e1ebe1e4bfdc0eb2056b23a5078cf3e..407d068d42085b0ba257e0c543af683a516ec9df 100644 (file)
@@ -6385,7 +6385,6 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
                   struct btrfs_inode *parent_inode, struct btrfs_inode *inode,
                   const char *name, int name_len, int add_backref, u64 index)
 {
-       struct btrfs_fs_info *fs_info = trans->fs_info;
        int ret = 0;
        struct btrfs_key key;
        struct btrfs_root *root = parent_inode->root;
@@ -6401,7 +6400,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
        }
 
        if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
-               ret = btrfs_add_root_ref(trans, fs_info, key.objectid,
+               ret = btrfs_add_root_ref(trans, key.objectid,
                                         root->root_key.objectid, parent_ino,
                                         index, name, name_len);
        } else if (add_backref) {
index 80fe3c654612be17d3e85b9cafc4bc8ad52a66b4..6eaadddaca9f643e101ec1315b63016961b60b72 100644 (file)
@@ -698,8 +698,7 @@ static noinline int create_subvol(struct inode *dir,
        ret = btrfs_update_inode(trans, root, dir);
        BUG_ON(ret);
 
-       ret = btrfs_add_root_ref(trans, fs_info,
-                                objectid, root->root_key.objectid,
+       ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid,
                                 btrfs_ino(BTRFS_I(dir)), index, name, namelen);
        BUG_ON(ret);
 
index 52fa133ab53c516145906838fe21025dee03ebd2..65bda0682928babb4671a154fbad886badbc3e7f 100644 (file)
@@ -412,12 +412,11 @@ out:
  *
  * Will return 0, -ENOMEM, or anything from the CoW path
  */
-int btrfs_add_root_ref(struct btrfs_trans_handle *trans,
-                      struct btrfs_fs_info *fs_info,
-                      u64 root_id, u64 ref_id, u64 dirid, u64 sequence,
-                      const char *name, int name_len)
+int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
+                      u64 ref_id, u64 dirid, u64 sequence, const char *name,
+                      int name_len)
 {
-       struct btrfs_root *tree_root = fs_info->tree_root;
+       struct btrfs_root *tree_root = trans->fs_info->tree_root;
        struct btrfs_key key;
        int ret;
        struct btrfs_path *path;
index aec208cbff0034e874f713327d8aff48a5ccc142..001ed1bc2aa89a294c1250831e58ecd670cb2ff9 100644 (file)
@@ -1573,7 +1573,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
        /*
         * insert root back/forward references
         */
-       ret = btrfs_add_root_ref(trans, fs_info, objectid,
+       ret = btrfs_add_root_ref(trans, objectid,
                                 parent_root->root_key.objectid,
                                 btrfs_ino(BTRFS_I(parent_inode)), index,
                                 dentry->d_name.name, dentry->d_name.len);