]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
btrfs: open code read_fs_root
authorDavid Sterba <dsterba@suse.com>
Fri, 15 May 2020 17:35:57 +0000 (19:35 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 25 May 2020 09:25:36 +0000 (11:25 +0200)
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 <dsterba@suse.com>
fs/btrfs/relocation.c

index 19db203a8f3bf218f05aa07b977ba87f82873080..018f830e31b581a2d1c04f49612732a914c499ab 100644 (file)
@@ -365,12 +365,6 @@ struct btrfs_root *find_reloc_root(struct btrfs_fs_info *fs_info, u64 bytenr)
        return btrfs_grab_root(root);
 }
 
-static struct btrfs_root *read_fs_root(struct btrfs_fs_info *fs_info,
-                                       u64 root_objectid)
-{
-       return btrfs_get_fs_root(fs_info, root_objectid, false);
-}
-
 /*
  * For useless nodes, do two major clean ups:
  *
@@ -1850,7 +1844,8 @@ again:
                                        struct btrfs_root, root_list);
                list_del_init(&reloc_root->root_list);
 
-               root = read_fs_root(fs_info, reloc_root->root_key.offset);
+               root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
+                               false);
                BUG_ON(IS_ERR(root));
                BUG_ON(root->reloc_root != reloc_root);
 
@@ -1911,7 +1906,8 @@ again:
                reloc_root = list_entry(reloc_roots.next,
                                        struct btrfs_root, root_list);
 
-               root = read_fs_root(fs_info, reloc_root->root_key.offset);
+               root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
+                                        false);
                if (btrfs_root_refs(&reloc_root->root_item) > 0) {
                        BUG_ON(IS_ERR(root));
                        BUG_ON(root->reloc_root != reloc_root);
@@ -1995,7 +1991,7 @@ static int record_reloc_root_in_trans(struct btrfs_trans_handle *trans,
        if (reloc_root->last_trans == trans->transid)
                return 0;
 
-       root = read_fs_root(fs_info, reloc_root->root_key.offset);
+       root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset, false);
        BUG_ON(IS_ERR(root));
        BUG_ON(root->reloc_root != reloc_root);
        ret = btrfs_record_root_in_trans(trans, root);
@@ -3771,8 +3767,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
                list_add(&reloc_root->root_list, &reloc_roots);
 
                if (btrfs_root_refs(&reloc_root->root_item) > 0) {
-                       fs_root = read_fs_root(fs_info,
-                                              reloc_root->root_key.offset);
+                       fs_root = btrfs_get_fs_root(fs_info,
+                                       reloc_root->root_key.offset, false);
                        if (IS_ERR(fs_root)) {
                                ret = PTR_ERR(fs_root);
                                if (ret != -ENOENT) {
@@ -3828,7 +3824,8 @@ int btrfs_recover_relocation(struct btrfs_root *root)
                        continue;
                }
 
-               fs_root = read_fs_root(fs_info, reloc_root->root_key.offset);
+               fs_root = btrfs_get_fs_root(fs_info, reloc_root->root_key.offset,
+                                           false);
                if (IS_ERR(fs_root)) {
                        err = PTR_ERR(fs_root);
                        list_add_tail(&reloc_root->root_list, &reloc_roots);