mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
b6e9f16c5f
commit
05947ae186
|
@ -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);
|
||||
|
||||
/*
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue