summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2021-02-10 21:25:15 -0800
committerDavid Sterba <dsterba@suse.com>2021-04-19 17:25:14 +0200
commit05947ae18692736c665be4dfa5bb39a54c6b98ae (patch)
treedc2997bde8aeef74e9445fb4260331d9955f51c1 /fs/btrfs/inode.c
parentb6e9f16c5fda08e4af8c675b71be580dac3286d6 (diff)
downloadlinux-05947ae18692736c665be4dfa5bb39a54c6b98ae.tar.bz2
btrfs: unexport btrfs_extent_readonly() and make it static
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r--fs/btrfs/inode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 726d89c010fd..988b53fa41e5 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -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)
*