diff options
author | Lu Fengqi <lufq.fnst@cn.fujitsu.com> | 2018-07-31 23:32:28 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-08-06 07:13:00 -0400 |
commit | 3ee1c5530e649182e602eb2f81193289c4d2e655 (patch) | |
tree | 16cd037da6d7f124db1ba19c5096d200ed7bba91 /fs/btrfs | |
parent | ab9ce7d42bf66f0750a4ca4a228a2db238376afb (diff) |
btrfs: Remove fs_info from btrfs_del_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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/ctree.h | 7 | ||||
-rw-r--r-- | fs/btrfs/inode.c | 8 | ||||
-rw-r--r-- | fs/btrfs/root-tree.c | 9 |
3 files changed, 10 insertions, 14 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 9ef47a171e2f..3677082ddf4c 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -2988,10 +2988,9 @@ int btrfs_add_root_ref(struct btrfs_trans_handle *trans, | |||
2988 | struct btrfs_fs_info *fs_info, | 2988 | struct btrfs_fs_info *fs_info, |
2989 | u64 root_id, u64 ref_id, u64 dirid, u64 sequence, | 2989 | u64 root_id, u64 ref_id, u64 dirid, u64 sequence, |
2990 | const char *name, int name_len); | 2990 | const char *name, int name_len); |
2991 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, | 2991 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, |
2992 | struct btrfs_fs_info *fs_info, | 2992 | u64 ref_id, u64 dirid, u64 *sequence, const char *name, |
2993 | u64 root_id, u64 ref_id, u64 dirid, u64 *sequence, | 2993 | int name_len); |
2994 | const char *name, int name_len); | ||
2995 | int btrfs_del_root(struct btrfs_trans_handle *trans, | 2994 | int btrfs_del_root(struct btrfs_trans_handle *trans, |
2996 | const struct btrfs_key *key); | 2995 | const struct btrfs_key *key); |
2997 | int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, | 2996 | int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root, |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 59b3ea32b6de..7bf4a8d07e1e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -4085,7 +4085,6 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, | |||
4085 | struct inode *dir, u64 objectid, | 4085 | struct inode *dir, u64 objectid, |
4086 | const char *name, int name_len) | 4086 | const char *name, int name_len) |
4087 | { | 4087 | { |
4088 | struct btrfs_fs_info *fs_info = root->fs_info; | ||
4089 | struct btrfs_path *path; | 4088 | struct btrfs_path *path; |
4090 | struct extent_buffer *leaf; | 4089 | struct extent_buffer *leaf; |
4091 | struct btrfs_dir_item *di; | 4090 | struct btrfs_dir_item *di; |
@@ -4118,9 +4117,8 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans, | |||
4118 | } | 4117 | } |
4119 | btrfs_release_path(path); | 4118 | btrfs_release_path(path); |
4120 | 4119 | ||
4121 | ret = btrfs_del_root_ref(trans, fs_info, objectid, | 4120 | ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid, |
4122 | root->root_key.objectid, dir_ino, | 4121 | dir_ino, &index, name, name_len); |
4123 | &index, name, name_len); | ||
4124 | if (ret < 0) { | 4122 | if (ret < 0) { |
4125 | if (ret != -ENOENT) { | 4123 | if (ret != -ENOENT) { |
4126 | btrfs_abort_transaction(trans, ret); | 4124 | btrfs_abort_transaction(trans, ret); |
@@ -6439,7 +6437,7 @@ fail_dir_item: | |||
6439 | if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { | 6437 | if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) { |
6440 | u64 local_index; | 6438 | u64 local_index; |
6441 | int err; | 6439 | int err; |
6442 | err = btrfs_del_root_ref(trans, fs_info, key.objectid, | 6440 | err = btrfs_del_root_ref(trans, key.objectid, |
6443 | root->root_key.objectid, parent_ino, | 6441 | root->root_key.objectid, parent_ino, |
6444 | &local_index, name, name_len); | 6442 | &local_index, name, name_len); |
6445 | 6443 | ||
diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c index f7c14c454f91..52fa133ab53c 100644 --- a/fs/btrfs/root-tree.c +++ b/fs/btrfs/root-tree.c | |||
@@ -341,13 +341,12 @@ out: | |||
341 | return ret; | 341 | return ret; |
342 | } | 342 | } |
343 | 343 | ||
344 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, | 344 | int btrfs_del_root_ref(struct btrfs_trans_handle *trans, u64 root_id, |
345 | struct btrfs_fs_info *fs_info, | 345 | u64 ref_id, u64 dirid, u64 *sequence, const char *name, |
346 | u64 root_id, u64 ref_id, u64 dirid, u64 *sequence, | 346 | int name_len) |
347 | const char *name, int name_len) | ||
348 | 347 | ||
349 | { | 348 | { |
350 | struct btrfs_root *tree_root = fs_info->tree_root; | 349 | struct btrfs_root *tree_root = trans->fs_info->tree_root; |
351 | struct btrfs_path *path; | 350 | struct btrfs_path *path; |
352 | struct btrfs_root_ref *ref; | 351 | struct btrfs_root_ref *ref; |
353 | struct extent_buffer *leaf; | 352 | struct extent_buffer *leaf; |