Commit 84db5ccf authored by David Sterba's avatar David Sterba

btrfs: merge free_fs_root helpers

The exported helper just calls the static one. There's no obvious reason
to have them separate eg. for performance reasons where the static one
could be better optimized in the same unit. There's a slight decrease in
code size and stack consumption.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2ffad70e
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
static const struct extent_io_ops btree_extent_io_ops; static const struct extent_io_ops btree_extent_io_ops;
static void end_workqueue_fn(struct btrfs_work *work); static void end_workqueue_fn(struct btrfs_work *work);
static void free_fs_root(struct btrfs_root *root);
static void btrfs_destroy_ordered_extents(struct btrfs_root *root); static void btrfs_destroy_ordered_extents(struct btrfs_root *root);
static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans, static int btrfs_destroy_delayed_refs(struct btrfs_transaction *trans,
struct btrfs_fs_info *fs_info); struct btrfs_fs_info *fs_info);
...@@ -1504,7 +1503,7 @@ int btrfs_init_fs_root(struct btrfs_root *root) ...@@ -1504,7 +1503,7 @@ int btrfs_init_fs_root(struct btrfs_root *root)
return 0; return 0;
fail: fail:
/* the caller is responsible to call free_fs_root */ /* The caller is responsible to call btrfs_free_fs_root */
return ret; return ret;
} }
...@@ -1609,14 +1608,14 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info, ...@@ -1609,14 +1608,14 @@ struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
ret = btrfs_insert_fs_root(fs_info, root); ret = btrfs_insert_fs_root(fs_info, root);
if (ret) { if (ret) {
if (ret == -EEXIST) { if (ret == -EEXIST) {
free_fs_root(root); btrfs_free_fs_root(root);
goto again; goto again;
} }
goto fail; goto fail;
} }
return root; return root;
fail: fail:
free_fs_root(root); btrfs_free_fs_root(root);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -3831,10 +3830,10 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info, ...@@ -3831,10 +3830,10 @@ void btrfs_drop_and_free_fs_root(struct btrfs_fs_info *fs_info,
__btrfs_remove_free_space_cache(root->free_ino_pinned); __btrfs_remove_free_space_cache(root->free_ino_pinned);
if (root->free_ino_ctl) if (root->free_ino_ctl)
__btrfs_remove_free_space_cache(root->free_ino_ctl); __btrfs_remove_free_space_cache(root->free_ino_ctl);
free_fs_root(root); btrfs_free_fs_root(root);
} }
static void free_fs_root(struct btrfs_root *root) void btrfs_free_fs_root(struct btrfs_root *root)
{ {
iput(root->ino_cache_inode); iput(root->ino_cache_inode);
WARN_ON(!RB_EMPTY_ROOT(&root->inode_tree)); WARN_ON(!RB_EMPTY_ROOT(&root->inode_tree));
...@@ -3849,11 +3848,6 @@ static void free_fs_root(struct btrfs_root *root) ...@@ -3849,11 +3848,6 @@ static void free_fs_root(struct btrfs_root *root)
btrfs_put_fs_root(root); btrfs_put_fs_root(root);
} }
void btrfs_free_fs_root(struct btrfs_root *root)
{
free_fs_root(root);
}
int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info) int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info)
{ {
u64 root_objectid = 0; u64 root_objectid = 0;
......
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