From 05947ae18692736c665be4dfa5bb39a54c6b98ae Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Wed, 10 Feb 2021 21:25:15 -0800 Subject: 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 Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/inode.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fs/btrfs/inode.c') 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) * -- cgit v1.2.3