summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLu Fengqi <lufq.fnst@cn.fujitsu.com>2018-07-31 23:32:29 -0400
committerDavid Sterba <dsterba@suse.com>2018-08-06 07:13:00 -0400
commit6025c19fb208e93b99eafc304e7f16160e49fc88 (patch)
tree6a0b47ea03d36720cb508b24b958c2b20a5d6938
parent3ee1c5530e649182e602eb2f81193289c4d2e655 (diff)
btrfs: Remove fs_info from btrfs_add_root_ref
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>
-rw-r--r--fs/btrfs/ctree.h7
-rw-r--r--fs/btrfs/inode.c3
-rw-r--r--fs/btrfs/ioctl.c3
-rw-r--r--fs/btrfs/root-tree.c9
-rw-r--r--fs/btrfs/transaction.c2
5 files changed, 10 insertions, 14 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 3677082ddf4c..c275ea258f9a 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2984,10 +2984,9 @@ void btrfs_put_tree_mod_seq(struct btrfs_fs_info *fs_info,
2984int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq); 2984int btrfs_old_root_level(struct btrfs_root *root, u64 time_seq);
2985 2985
2986/* root-item.c */ 2986/* root-item.c */
2987int btrfs_add_root_ref(struct btrfs_trans_handle *trans, 2987int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
2988 struct btrfs_fs_info *fs_info, 2988 u64 ref_id, u64 dirid, u64 sequence, const char *name,
2989 u64 root_id, u64 ref_id, u64 dirid, u64 sequence, 2989 int name_len);
2990 const char *name, int name_len);
2991int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, 2990int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
2992 u64 ref_id, u64 dirid, u64 *sequence, const char *name, 2991 u64 ref_id, u64 dirid, u64 *sequence, const char *name,
2993 int name_len); 2992 int name_len);
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 7bf4a8d07e1e..407d068d4208 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6385,7 +6385,6 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
6385 struct btrfs_inode *parent_inode, struct btrfs_inode *inode, 6385 struct btrfs_inode *parent_inode, struct btrfs_inode *inode,
6386 const char *name, int name_len, int add_backref, u64 index) 6386 const char *name, int name_len, int add_backref, u64 index)
6387{ 6387{
6388 struct btrfs_fs_info *fs_info = trans->fs_info;
6389 int ret = 0; 6388 int ret = 0;
6390 struct btrfs_key key; 6389 struct btrfs_key key;
6391 struct btrfs_root *root = parent_inode->root; 6390 struct btrfs_root *root = parent_inode->root;
@@ -6401,7 +6400,7 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
6401 } 6400 }
6402 6401
6403 if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { 6402 if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
6404 ret = btrfs_add_root_ref(trans, fs_info, key.objectid, 6403 ret = btrfs_add_root_ref(trans, key.objectid,
6405 root->root_key.objectid, parent_ino, 6404 root->root_key.objectid, parent_ino,
6406 index, name, name_len); 6405 index, name, name_len);
6407 } else if (add_backref) { 6406 } else if (add_backref) {
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 80fe3c654612..6eaadddaca9f 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -698,8 +698,7 @@ static noinline int create_subvol(struct inode *dir,
698 ret = btrfs_update_inode(trans, root, dir); 698 ret = btrfs_update_inode(trans, root, dir);
699 BUG_ON(ret); 699 BUG_ON(ret);
700 700
701 ret = btrfs_add_root_ref(trans, fs_info, 701 ret = btrfs_add_root_ref(trans, objectid, root->root_key.objectid,
702 objectid, root->root_key.objectid,
703 btrfs_ino(BTRFS_I(dir)), index, name, namelen); 702 btrfs_ino(BTRFS_I(dir)), index, name, namelen);
704 BUG_ON(ret); 703 BUG_ON(ret);
705 704
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
index 52fa133ab53c..65bda0682928 100644
--- a/fs/btrfs/root-tree.c
+++ b/fs/btrfs/root-tree.c
@@ -412,12 +412,11 @@ out:
412 * 412 *
413 * Will return 0, -ENOMEM, or anything from the CoW path 413 * Will return 0, -ENOMEM, or anything from the CoW path
414 */ 414 */
415int btrfs_add_root_ref(struct btrfs_trans_handle *trans, 415int btrfs_add_root_ref(struct btrfs_trans_handle *trans, u64 root_id,
416 struct btrfs_fs_info *fs_info, 416 u64 ref_id, u64 dirid, u64 sequence, const char *name,
417 u64 root_id, u64 ref_id, u64 dirid, u64 sequence, 417 int name_len)
418 const char *name, int name_len)
419{ 418{
420 struct btrfs_root *tree_root = fs_info->tree_root; 419 struct btrfs_root *tree_root = trans->fs_info->tree_root;
421 struct btrfs_key key; 420 struct btrfs_key key;
422 int ret; 421 int ret;
423 struct btrfs_path *path; 422 struct btrfs_path *path;
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index aec208cbff00..001ed1bc2aa8 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1573,7 +1573,7 @@ static noinline int create_pending_snapshot(struct btrfs_trans_handle *trans,
1573 /* 1573 /*
1574 * insert root back/forward references 1574 * insert root back/forward references
1575 */ 1575 */
1576 ret = btrfs_add_root_ref(trans, fs_info, objectid, 1576 ret = btrfs_add_root_ref(trans, objectid,
1577 parent_root->root_key.objectid, 1577 parent_root->root_key.objectid,
1578 btrfs_ino(BTRFS_I(parent_inode)), index, 1578 btrfs_ino(BTRFS_I(parent_inode)), index,
1579 dentry->d_name.name, dentry->d_name.len); 1579 dentry->d_name.name, dentry->d_name.len);