@@ -365,12 +365,6 @@ struct btrfs_root *find_reloc_root(struct btrfs_fs_info *fs_info, u64 bytenr)
365
365
return btrfs_grab_root (root );
366
366
}
367
367
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
-
374
368
/*
375
369
* For useless nodes, do two major clean ups:
376
370
*
@@ -1850,7 +1844,8 @@ int prepare_to_merge(struct reloc_control *rc, int err)
1850
1844
struct btrfs_root , root_list );
1851
1845
list_del_init (& reloc_root -> root_list );
1852
1846
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);
1854
1849
BUG_ON (IS_ERR (root ));
1855
1850
BUG_ON (root -> reloc_root != reloc_root );
1856
1851
@@ -1911,7 +1906,8 @@ void merge_reloc_roots(struct reloc_control *rc)
1911
1906
reloc_root = list_entry (reloc_roots .next ,
1912
1907
struct btrfs_root , root_list );
1913
1908
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);
1915
1911
if (btrfs_root_refs (& reloc_root -> root_item ) > 0 ) {
1916
1912
BUG_ON (IS_ERR (root ));
1917
1913
BUG_ON (root -> reloc_root != reloc_root );
@@ -1995,7 +1991,7 @@ static int record_reloc_root_in_trans(struct btrfs_trans_handle *trans,
1995
1991
if (reloc_root -> last_trans == trans -> transid )
1996
1992
return 0 ;
1997
1993
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 );
1999
1995
BUG_ON (IS_ERR (root ));
2000
1996
BUG_ON (root -> reloc_root != reloc_root );
2001
1997
ret = btrfs_record_root_in_trans (trans , root );
@@ -3771,8 +3767,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
3771
3767
list_add (& reloc_root -> root_list , & reloc_roots );
3772
3768
3773
3769
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 );
3776
3772
if (IS_ERR (fs_root )) {
3777
3773
ret = PTR_ERR (fs_root );
3778
3774
if (ret != - ENOENT ) {
@@ -3828,7 +3824,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
3828
3824
continue ;
3829
3825
}
3830
3826
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);
3832
3829
if (IS_ERR (fs_root )) {
3833
3830
err = PTR_ERR (fs_root );
3834
3831
list_add_tail (& reloc_root -> root_list , & reloc_roots );
0 commit comments