Commit 6025c19f authored by Lu Fengqi's avatar Lu Fengqi Committed by David Sterba

btrfs: Remove fs_info from btrfs_add_root_ref

It can be referenced from the passed transaction handle.
Signed-off-by: default avatarLu Fengqi <lufq.fnst@cn.fujitsu.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3ee1c553
...@@ -2984,10 +2984,9 @@ void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info, ...@@ -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); int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq);
/* root-item.c */ /* root-item.c */
int btrfs_add_root_ref(struct btrfs_trans_handle *trans, int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
struct btrfs_fs_info *fs_info, u64 ref_id, u64 dirid, u64 sequence, const char *name,
u64 root_id, u64 ref_id, u64 dirid, u64 sequence, int name_len);
const char *name, int name_len);
int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
u64 ref_id, u64 dirid, u64 *sequence, const char *name, u64 ref_id, u64 dirid, u64 *sequence, const char *name,
int name_len); int name_len);
......
...@@ -6385,7 +6385,6 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, ...@@ -6385,7 +6385,6 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
struct btrfs_inode *parent_inode, struct btrfs_inode *inode, struct btrfs_inode *parent_inode, struct btrfs_inode *inode,
const char *name, int name_len, int add_backref, u64 index) const char *name, int name_len, int add_backref, u64 index)
{ {
struct btrfs_fs_info *fs_info = trans->fs_info;
int ret = 0; int ret = 0;
struct btrfs_key key; struct btrfs_key key;
struct btrfs_root *root = parent_inode->root; struct btrfs_root *root = parent_inode->root;
...@@ -6401,7 +6400,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans, ...@@ -6401,7 +6400,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
} }
if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { 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, root->root_key.objectid, parent_ino,
index, name, name_len); index, name, name_len);
} else if (add_backref) { } else if (add_backref) {
......
...@@ -698,8 +698,7 @@ static noinline int create_subvol(struct inode *dir, ...@@ -698,8 +698,7 @@ static noinline int create_subvol(struct inode *dir,
ret = btrfs_update_inode(trans, root, dir); ret = btrfs_update_inode(trans, root, dir);
BUG_ON(ret); BUG_ON(ret);
ret = btrfs_add_root_ref(trans, fs_info, ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid,
objectid, root->root_key.objectid,
btrfs_ino(BTRFS_I(dir)), index, name, namelen); btrfs_ino(BTRFS_I(dir)), index, name, namelen);
BUG_ON(ret); BUG_ON(ret);
......
...@@ -412,12 +412,11 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, ...@@ -412,12 +412,11 @@ int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
* *
* Will return 0, -ENOMEM, or anything from the CoW path * Will return 0, -ENOMEM, or anything from the CoW path
*/ */
int btrfs_add_root_ref(struct btrfs_trans_handle *trans, int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
struct btrfs_fs_info *fs_info, u64 ref_id, u64 dirid, u64 sequence, const char *name,
u64 root_id, u64 ref_id, u64 dirid, u64 sequence, int name_len)
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; struct btrfs_key key;
int ret; int ret;
struct btrfs_path *path; struct btrfs_path *path;
......
...@@ -1573,7 +1573,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans, ...@@ -1573,7 +1573,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
/* /*
* insert root back/forward references * 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, parent_root->root_key.objectid,
btrfs_ino(BTRFS_I(parent_inode)), index, btrfs_ino(BTRFS_I(parent_inode)), index,
dentry->d_name.name, dentry->d_name.len); dentry->d_name.name, dentry->d_name.len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment