Skip to content

Commit a820feb

Browse files
committed
btrfs: open code read_fs_root
After the update to btrfs_get_fs_root, read_fs_root has become trivial wrapper that can be open coded. Signed-off-by: David Sterba <[email protected]>
1 parent 56e9357 commit a820feb

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

fs/btrfs/relocation.c

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -365,12 +365,6 @@ struct btrfs_root *find_reloc_root(struct btrfs_fs_info *fs_info, u64 bytenr)
365365
return btrfs_grab_root(root);
366366
}
367367

368-
static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info,
369-
u64 root_objectid)
370-
{
371-
return btrfs_get_fs_root(fs_info, root_objectid, false);
372-
}
373-
374368
/*
375369
* For useless nodes, do two major clean ups:
376370
*
@@ -1850,7 +1844,8 @@ int prepare_to_merge(struct reloc_control *rc, int err)
18501844
struct btrfs_root, root_list);
18511845
list_del_init(&reloc_root->root_list);
18521846

1853-
root = read_fs_root(fs_info, reloc_root->root_key.offset);
1847+
root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
1848+
false);
18541849
BUG_ON(IS_ERR(root));
18551850
BUG_ON(root->reloc_root != reloc_root);
18561851

@@ -1911,7 +1906,8 @@ void merge_reloc_roots(struct reloc_control *rc)
19111906
reloc_root = list_entry(reloc_roots.next,
19121907
struct btrfs_root, root_list);
19131908

1914-
root = read_fs_root(fs_info, reloc_root->root_key.offset);
1909+
root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
1910+
false);
19151911
if (btrfs_root_refs(&reloc_root->root_item) > 0) {
19161912
BUG_ON(IS_ERR(root));
19171913
BUG_ON(root->reloc_root != reloc_root);
@@ -1995,7 +1991,7 @@ static int record_reloc_root_in_trans(struct btrfs_trans_handle *trans,
19951991
if (reloc_root->last_trans == trans->transid)
19961992
return 0;
19971993

1998-
root = read_fs_root(fs_info, reloc_root->root_key.offset);
1994+
root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, false);
19991995
BUG_ON(IS_ERR(root));
20001996
BUG_ON(root->reloc_root != reloc_root);
20011997
ret = btrfs_record_root_in_trans(trans, root);
@@ -3771,8 +3767,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
37713767
list_add(&reloc_root->root_list, &reloc_roots);
37723768

37733769
if (btrfs_root_refs(&reloc_root->root_item) > 0) {
3774-
fs_root = read_fs_root(fs_info,
3775-
reloc_root->root_key.offset);
3770+
fs_root = btrfs_get_fs_root(fs_info,
3771+
reloc_root->root_key.offset, false);
37763772
if (IS_ERR(fs_root)) {
37773773
ret = PTR_ERR(fs_root);
37783774
if (ret != -ENOENT) {
@@ -3828,7 +3824,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
38283824
continue;
38293825
}
38303826

3831-
fs_root = read_fs_root(fs_info, reloc_root->root_key.offset);
3827+
fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
3828+
false);
38323829
if (IS_ERR(fs_root)) {
38333830
err = PTR_ERR(fs_root);
38343831
list_add_tail(&reloc_root->root_list, &reloc_roots);

0 commit comments

Comments
 (0)