Commit 3619c94f authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: open code btrfs_read_fs_root_no_name



All this does is call btrfs_get_fs_root() with check_ref == true.  Just
use btrfs_get_fs_root() so we don't have a bunch of different helpers
that do the same thing.

Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 83db2aad
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3178,7 +3178,7 @@ int __cold open_ctree(struct super_block *sb,
	location.type = BTRFS_ROOT_ITEM_KEY;
	location.offset = 0;

	fs_info->fs_root = btrfs_read_fs_root_no_name(fs_info, &location);
	fs_info->fs_root = btrfs_get_fs_root(fs_info, &location, true);
	if (IS_ERR(fs_info->fs_root)) {
		err = PTR_ERR(fs_info->fs_root);
		btrfs_warn(fs_info, "failed to read fs tree: %d", err);
+0 −6
Original line number Diff line number Diff line
@@ -70,12 +70,6 @@ void btrfs_free_fs_roots(struct btrfs_fs_info *fs_info);
struct btrfs_root *btrfs_get_fs_root(struct btrfs_fs_info *fs_info,
				     struct btrfs_key *key,
				     bool check_ref);
static inline struct btrfs_root *
btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
			   struct btrfs_key *location)
{
	return btrfs_get_fs_root(fs_info, location, true);
}

int btrfs_cleanup_fs_roots(struct btrfs_fs_info *fs_info);
void btrfs_btree_balance_dirty(struct btrfs_fs_info *fs_info);
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static struct dentry *btrfs_get_dentry(struct super_block *sb, u64 objectid,

	index = srcu_read_lock(&fs_info->subvol_srcu);

	root = btrfs_read_fs_root_no_name(fs_info, &key);
	root = btrfs_get_fs_root(fs_info, &key, true);
	if (IS_ERR(root)) {
		err = PTR_ERR(root);
		goto fail;
+1 −1
Original line number Diff line number Diff line
@@ -287,7 +287,7 @@ static int __btrfs_run_defrag_inode(struct btrfs_fs_info *fs_info,

	index = srcu_read_lock(&fs_info->subvol_srcu);

	inode_root = btrfs_read_fs_root_no_name(fs_info, &key);
	inode_root = btrfs_get_fs_root(fs_info, &key, true);
	if (IS_ERR(inode_root)) {
		ret = PTR_ERR(inode_root);
		goto cleanup;
+1 −1
Original line number Diff line number Diff line
@@ -5153,7 +5153,7 @@ static int fixup_tree_root_location(struct btrfs_fs_info *fs_info,

	btrfs_release_path(path);

	new_root = btrfs_read_fs_root_no_name(fs_info, location);
	new_root = btrfs_get_fs_root(fs_info, location, true);
	if (IS_ERR(new_root)) {
		err = PTR_ERR(new_root);
		goto out;
Loading