diff options
author | Anand Jain <anand.jain@oracle.com> | 2021-02-10 21:25:15 -0800 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-04-19 17:25:14 +0200 |
commit | 05947ae18692736c665be4dfa5bb39a54c6b98ae (patch) | |
tree | dc2997bde8aeef74e9445fb4260331d9955f51c1 /fs/btrfs/inode.c | |
parent | b6e9f16c5fda08e4af8c675b71be580dac3286d6 (diff) | |
download | lwn-05947ae18692736c665be4dfa5bb39a54c6b98ae.tar.gz lwn-05947ae18692736c665be4dfa5bb39a54c6b98ae.zip |
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.c | 13 |
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) * |