]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
btrfs: unexport btrfs_extent_readonly() and make it static
authorAnand Jain <anand.jain@oracle.com>
Thu, 11 Feb 2021 05:25:15 +0000 (21:25 -0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 19 Apr 2021 15:25:14 +0000 (17:25 +0200)
btrfs_extent_readonly() is used by can_nocow_extent() in inode.c. So
move it from extent-tree.c to inode.c and declare it as static.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c
fs/btrfs/inode.c

index 0498a81d5db02476b24b7173b3a9e7405cd32f2e..014afeb8d626be40bf0318ed00274aede159c59a 100644 (file)
@@ -2691,7 +2691,6 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans);
 int btrfs_inc_extent_ref(struct btrfs_trans_handle *trans,
                         struct btrfs_ref *generic_ref);
 
-int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr);
 void btrfs_clear_space_info_full(struct btrfs_fs_info *info);
 
 /*
index 36a3c973fda1029529f8cdaebca0e0be99539020..2482b26b19714acf44a0f3fdfc24599cb82f54d0 100644 (file)
@@ -2490,19 +2490,6 @@ int btrfs_dec_ref(struct btrfs_trans_handle *trans, struct btrfs_root *root,
        return __btrfs_mod_ref(trans, root, buf, full_backref, 0);
 }
 
-int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
-{
-       struct btrfs_block_group *block_group;
-       int readonly = 0;
-
-       block_group = btrfs_lookup_block_group(fs_info, bytenr);
-       if (!block_group || block_group->ro)
-               readonly = 1;
-       if (block_group)
-               btrfs_put_block_group(block_group);
-       return readonly;
-}
-
 static u64 get_alloc_profile_by_root(struct btrfs_root *root, int data)
 {
        struct btrfs_fs_info *fs_info = root->fs_info;
index 726d89c010fdc34dd18ffb7629638862d3d392c7..988b53fa41e5e42b89e9cf290ad9373eea766799 100644 (file)
@@ -7262,6 +7262,19 @@ static struct extent_map *btrfs_new_extent_direct(struct btrfs_inode *inode,
        return em;
 }
 
+static int btrfs_extent_readonly(struct btrfs_fs_info *fs_info, u64 bytenr)
+{
+       struct btrfs_block_group *block_group;
+       int readonly = 0;
+
+       block_group = btrfs_lookup_block_group(fs_info, bytenr);
+       if (!block_group || block_group->ro)
+               readonly = 1;
+       if (block_group)
+               btrfs_put_block_group(block_group);
+       return readonly;
+}
+
 /*
  * Check if we can do nocow write into the range [@offset, @offset + @len)
  *