Commit 0078a9f9 authored by Nikolay Borisov's avatar Nikolay Borisov Committed by David Sterba

btrfs: Remove block_rsv parameter from btrfs_drop_snapshot

It's no longer used following 30d40577 ("btrfs: reloc: Also queue
orphan reloc tree for cleanup to avoid BUG_ON()"), so just remove it.
Signed-off-by: default avatarNikolay Borisov <nborisov@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 63f018be
...@@ -2657,9 +2657,8 @@ static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p) ...@@ -2657,9 +2657,8 @@ static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p)
return btrfs_next_old_item(root, p, 0); return btrfs_next_old_item(root, p, 0);
} }
int btrfs_leaf_free_space(struct extent_buffer *leaf); int btrfs_leaf_free_space(struct extent_buffer *leaf);
int __must_check btrfs_drop_snapshot(struct btrfs_root *root, int __must_check btrfs_drop_snapshot(struct btrfs_root *root, int update_ref,
struct btrfs_block_rsv *block_rsv, int for_reloc);
int update_ref, int for_reloc);
int btrfs_drop_subtree(struct btrfs_trans_handle *trans, int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct btrfs_root *root,
struct extent_buffer *node, struct extent_buffer *node,
......
...@@ -5288,9 +5288,7 @@ static noinline int walk_up_tree(struct btrfs_trans_handle *trans, ...@@ -5288,9 +5288,7 @@ static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
* *
* If called with for_reloc == 0, may exit early with -EAGAIN * If called with for_reloc == 0, may exit early with -EAGAIN
*/ */
int btrfs_drop_snapshot(struct btrfs_root *root, int btrfs_drop_snapshot(struct btrfs_root *root, int update_ref, int for_reloc)
struct btrfs_block_rsv *block_rsv, int update_ref,
int for_reloc)
{ {
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_path *path; struct btrfs_path *path;
...@@ -5329,9 +5327,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root, ...@@ -5329,9 +5327,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
if (err) if (err)
goto out_end_trans; goto out_end_trans;
if (block_rsv)
trans->block_rsv = block_rsv;
/* /*
* This will help us catch people modifying the fs tree while we're * This will help us catch people modifying the fs tree while we're
* dropping it. It is unsafe to mess with the fs tree while it's being * dropping it. It is unsafe to mess with the fs tree while it's being
...@@ -5459,8 +5454,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root, ...@@ -5459,8 +5454,6 @@ int btrfs_drop_snapshot(struct btrfs_root *root,
err = PTR_ERR(trans); err = PTR_ERR(trans);
goto out_free; goto out_free;
} }
if (block_rsv)
trans->block_rsv = block_rsv;
} }
} }
btrfs_release_path(path); btrfs_release_path(path);
......
...@@ -2276,7 +2276,7 @@ static int clean_dirty_subvols(struct reloc_control *rc) ...@@ -2276,7 +2276,7 @@ static int clean_dirty_subvols(struct reloc_control *rc)
root->reloc_root = NULL; root->reloc_root = NULL;
if (reloc_root) { if (reloc_root) {
ret2 = btrfs_drop_snapshot(reloc_root, NULL, 0, 1); ret2 = btrfs_drop_snapshot(reloc_root, 0, 1);
if (ret2 < 0 && !ret) if (ret2 < 0 && !ret)
ret = ret2; ret = ret2;
} }
...@@ -2289,7 +2289,7 @@ static int clean_dirty_subvols(struct reloc_control *rc) ...@@ -2289,7 +2289,7 @@ static int clean_dirty_subvols(struct reloc_control *rc)
btrfs_put_root(root); btrfs_put_root(root);
} else { } else {
/* Orphan reloc tree, just clean it up */ /* Orphan reloc tree, just clean it up */
ret2 = btrfs_drop_snapshot(root, NULL, 0, 1); ret2 = btrfs_drop_snapshot(root, 0, 1);
if (ret2 < 0 && !ret) if (ret2 < 0 && !ret)
ret = ret2; ret = ret2;
} }
......
...@@ -2427,9 +2427,9 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root) ...@@ -2427,9 +2427,9 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root)
if (btrfs_header_backref_rev(root->node) < if (btrfs_header_backref_rev(root->node) <
BTRFS_MIXED_BACKREF_REV) BTRFS_MIXED_BACKREF_REV)
ret = btrfs_drop_snapshot(root, NULL, 0, 0); ret = btrfs_drop_snapshot(root, 0, 0);
else else
ret = btrfs_drop_snapshot(root, NULL, 1, 0); ret = btrfs_drop_snapshot(root, 1, 0);
return (ret < 0) ? 0 : 1; return (ret < 0) ? 0 : 1;
} }
......
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