Skip to content

Commit

Permalink
btrfs: pass fs_info to btrfs_del_root instead of tree_root
Browse files Browse the repository at this point in the history
btrfs_del_roots always uses the tree_root.  Let's pass fs_info instead.

Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Jeff Mahoney authored and David Sterba committed Aug 21, 2017
1 parent 64ecdb6 commit 1cd5447
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2988,8 +2988,8 @@ int btrfs_del_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_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
const struct btrfs_key *key);
int btrfs_del_root(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, const struct btrfs_key *key);
int btrfs_insert_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
const struct btrfs_key *key,
struct btrfs_root_item *item);
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -9266,7 +9266,7 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
if (err)
goto out_end_trans;

ret = btrfs_del_root(trans, tree_root, &root->root_key);
ret = btrfs_del_root(trans, fs_info, &root->root_key);
if (ret) {
btrfs_abort_transaction(trans, ret);
goto out_end_trans;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/free-space-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -1257,7 +1257,7 @@ int btrfs_clear_free_space_tree(struct btrfs_fs_info *fs_info)
if (ret)
goto abort;

ret = btrfs_del_root(trans, tree_root, &free_space_root->root_key);
ret = btrfs_del_root(trans, fs_info, &free_space_root->root_key);
if (ret)
goto abort;

Expand Down
3 changes: 1 addition & 2 deletions fs/btrfs/qgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,6 @@ int btrfs_quota_enable(struct btrfs_trans_handle *trans,
int btrfs_quota_disable(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info)
{
struct btrfs_root *tree_root = fs_info->tree_root;
struct btrfs_root *quota_root;
int ret = 0;

Expand All @@ -968,7 +967,7 @@ int btrfs_quota_disable(struct btrfs_trans_handle *trans,
if (ret)
goto out;

ret = btrfs_del_root(trans, tree_root, &quota_root->root_key);
ret = btrfs_del_root(trans, fs_info, &quota_root->root_key);
if (ret)
goto out;

Expand Down
7 changes: 4 additions & 3 deletions fs/btrfs/root-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,10 +335,11 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info)
return err;
}

/* drop the root item for 'key' from 'root' */
int btrfs_del_root(struct btrfs_trans_handle *trans, struct btrfs_root *root,
const struct btrfs_key *key)
/* drop the root item for 'key' from the tree root */
int btrfs_del_root(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info, const struct btrfs_key *key)
{
struct btrfs_root *root = fs_info->tree_root;
struct btrfs_path *path;
int ret;

Expand Down

0 comments on commit 1cd5447

Please sign in to comment.