summaryrefslogtreecommitdiff
path: root/fs/btrfs/relocation.c
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2020-01-24 09:33:01 -0500
committerDavid Sterba <dsterba@suse.com>2020-03-23 17:01:33 +0100
commit0024652895e3479cd0d372f63b57d9581a0bdd38 (patch)
treec008726705f1e5c9aefab8392418bb9fbec51bdd /fs/btrfs/relocation.c
parentbd647ce385ec110fe7796267b6555873e48e44eb (diff)
downloadlwn-0024652895e3479cd0d372f63b57d9581a0bdd38.tar.gz
lwn-0024652895e3479cd0d372f63b57d9581a0bdd38.zip
btrfs: rename btrfs_put_fs_root and btrfs_grab_fs_root
We are now using these for all roots, rename them to btrfs_put_root() and btrfs_grab_root(); Reviewed-by: Nikolay Borisov <nborisov@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/relocation.c')
-rw-r--r--fs/btrfs/relocation.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 360f347d7524..034f5f151a74 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -303,7 +303,7 @@ static void free_backref_node(struct backref_cache *cache,
{
if (node) {
cache->nr_nodes--;
- btrfs_put_fs_root(node->root);
+ btrfs_put_root(node->root);
kfree(node);
}
}
@@ -637,7 +637,7 @@ static struct btrfs_root *find_reloc_root(struct reloc_control *rc,
root = (struct btrfs_root *)node->data;
}
spin_unlock(&rc->reloc_root_tree.lock);
- return btrfs_grab_fs_root(root);
+ return btrfs_grab_root(root);
}
static int is_cowonly_root(u64 root_objectid)
@@ -948,7 +948,7 @@ again:
ASSERT(btrfs_root_bytenr(&root->root_item) ==
cur->bytenr);
if (should_ignore_root(root)) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
list_add(&cur->list, &useless);
} else {
cur->root = root;
@@ -965,7 +965,7 @@ again:
ret = btrfs_search_slot(NULL, root, node_key, path2, 0, 0);
path2->lowest_level = 0;
if (ret < 0) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
err = ret;
goto out;
}
@@ -981,7 +981,7 @@ again:
root->root_key.objectid,
node_key->objectid, node_key->type,
node_key->offset);
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
err = -ENOENT;
goto out;
}
@@ -994,7 +994,7 @@ again:
ASSERT(btrfs_root_bytenr(&root->root_item) ==
lower->bytenr);
if (should_ignore_root(root)) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
list_add(&lower->list, &useless);
} else {
lower->root = root;
@@ -1004,7 +1004,7 @@ again:
edge = alloc_backref_edge(cache);
if (!edge) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
err = -ENOMEM;
goto out;
}
@@ -1014,7 +1014,7 @@ again:
if (!rb_node) {
upper = alloc_backref_node(cache);
if (!upper) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
free_backref_edge(cache, edge);
err = -ENOMEM;
goto out;
@@ -1063,7 +1063,7 @@ again:
edge->node[UPPER] = upper;
if (rb_node) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
break;
}
lower = upper;
@@ -1302,7 +1302,7 @@ static int clone_backref_node(struct btrfs_trans_handle *trans,
new_node->level = node->level;
new_node->lowest = node->lowest;
new_node->checked = 1;
- new_node->root = btrfs_grab_fs_root(dest);
+ new_node->root = btrfs_grab_root(dest);
ASSERT(new_node->root);
if (!node->lowest) {
@@ -2271,7 +2271,7 @@ static void insert_dirty_subvol(struct btrfs_trans_handle *trans,
btrfs_update_reloc_root(trans, root);
if (list_empty(&root->reloc_dirty_list)) {
- btrfs_grab_fs_root(root);
+ btrfs_grab_root(root);
list_add_tail(&root->reloc_dirty_list, &rc->dirty_subvol_roots);
}
}
@@ -2303,7 +2303,7 @@ static int clean_dirty_subvols(struct reloc_control *rc)
*/
smp_wmb();
clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
} else {
/* Orphan reloc tree, just clean it up */
ret2 = btrfs_drop_snapshot(root, NULL, 0, 1);
@@ -2528,7 +2528,7 @@ again:
btrfs_update_reloc_root(trans, root);
list_add(&reloc_root->root_list, &reloc_roots);
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
}
list_splice(&reloc_roots, &rc->reloc_roots);
@@ -2590,7 +2590,7 @@ again:
BUG_ON(root->reloc_root != reloc_root);
ret = merge_reloc_root(rc, root);
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
if (ret) {
if (list_empty(&reloc_root->root_list))
list_add_tail(&reloc_root->root_list,
@@ -2651,7 +2651,7 @@ static int record_reloc_root_in_trans(struct btrfs_trans_handle *trans,
BUG_ON(IS_ERR(root));
BUG_ON(root->reloc_root != reloc_root);
ret = btrfs_record_root_in_trans(trans, root);
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
return ret;
}
@@ -2686,8 +2686,8 @@ struct btrfs_root *select_reloc_root(struct btrfs_trans_handle *trans,
BUG_ON(next->new_bytenr);
BUG_ON(!list_empty(&next->list));
next->new_bytenr = root->node->start;
- btrfs_put_fs_root(next->root);
- next->root = btrfs_grab_fs_root(root);
+ btrfs_put_root(next->root);
+ next->root = btrfs_grab_root(root);
ASSERT(next->root);
list_add_tail(&next->list,
&rc->backref_cache.changed);
@@ -3160,8 +3160,8 @@ static int relocate_tree_block(struct btrfs_trans_handle *trans,
btrfs_record_root_in_trans(trans, root);
root = root->reloc_root;
node->new_bytenr = root->node->start;
- btrfs_put_fs_root(node->root);
- node->root = btrfs_grab_fs_root(root);
+ btrfs_put_root(node->root);
+ node->root = btrfs_grab_root(root);
ASSERT(node->root);
list_add_tail(&node->list, &rc->backref_cache.changed);
} else {
@@ -3857,7 +3857,7 @@ next:
}
out:
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
out_free:
btrfs_free_path(path);
return err;
@@ -4343,7 +4343,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
trans = btrfs_start_transaction(root, 6);
if (IS_ERR(trans)) {
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
return ERR_CAST(trans);
}
@@ -4363,7 +4363,7 @@ struct inode *create_reloc_inode(struct btrfs_fs_info *fs_info,
err = btrfs_orphan_add(trans, BTRFS_I(inode));
out:
- btrfs_put_fs_root(root);
+ btrfs_put_root(root);
btrfs_end_transaction(trans);
btrfs_btree_balance_dirty(fs_info);
if (err) {
@@ -4635,7 +4635,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
goto out;
}
} else {
- btrfs_put_fs_root(fs_root);
+ btrfs_put_root(fs_root);
}
}
@@ -4689,7 +4689,7 @@ int btrfs_recover_relocation(struct btrfs_root *root)
err = __add_reloc_root(reloc_root);
BUG_ON(err < 0); /* -ENOMEM or logic error */
fs_root->reloc_root = reloc_root;
- btrfs_put_fs_root(fs_root);
+ btrfs_put_root(fs_root);
}
err = btrfs_commit_transaction(trans);
@@ -4725,7 +4725,7 @@ out:
err = PTR_ERR(fs_root);
} else {
err = btrfs_orphan_cleanup(fs_root);
- btrfs_put_fs_root(fs_root);
+ btrfs_put_root(fs_root);
}
}
return err;