mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 04:21:09 -04:00
btrfs: collapse __btrfs_qgroup_reserve_meta() into btrfs_qgroup_reserve_meta_prealloc()
Since __btrfs_qgroup_reserve_meta() is only called by btrfs_qgroup_reserve_meta_prealloc(), which is a simple inline wrapper, get rid of the later and rename __btrfs_qgroup_reserve_meta() to the later. Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
committed by
David Sterba
parent
5adf3f32c0
commit
534c0adacd
@@ -4516,20 +4516,21 @@ int btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
|
||||
return ret;
|
||||
}
|
||||
|
||||
int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
|
||||
enum btrfs_qgroup_rsv_type type, bool enforce,
|
||||
bool noflush)
|
||||
int btrfs_qgroup_reserve_meta_prealloc(struct btrfs_root *root, int num_bytes,
|
||||
bool enforce, bool noflush)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = btrfs_qgroup_reserve_meta(root, num_bytes, type, enforce);
|
||||
ret = btrfs_qgroup_reserve_meta(root, num_bytes,
|
||||
BTRFS_QGROUP_RSV_META_PREALLOC, enforce);
|
||||
if ((ret <= 0 && ret != -EDQUOT) || noflush)
|
||||
return ret;
|
||||
|
||||
ret = try_flush_qgroup(root);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
return btrfs_qgroup_reserve_meta(root, num_bytes, type, enforce);
|
||||
return btrfs_qgroup_reserve_meta(root, num_bytes,
|
||||
BTRFS_QGROUP_RSV_META_PREALLOC, enforce);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -394,19 +394,8 @@ int btrfs_qgroup_free_data(struct btrfs_inode *inode,
|
||||
u64 len, u64 *freed);
|
||||
int btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
|
||||
enum btrfs_qgroup_rsv_type type, bool enforce);
|
||||
int __btrfs_qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
|
||||
enum btrfs_qgroup_rsv_type type, bool enforce,
|
||||
bool noflush);
|
||||
|
||||
static inline int btrfs_qgroup_reserve_meta_prealloc(struct btrfs_root *root,
|
||||
int num_bytes, bool enforce,
|
||||
bool noflush)
|
||||
{
|
||||
return __btrfs_qgroup_reserve_meta(root, num_bytes,
|
||||
BTRFS_QGROUP_RSV_META_PREALLOC,
|
||||
enforce, noflush);
|
||||
}
|
||||
|
||||
int btrfs_qgroup_reserve_meta_prealloc(struct btrfs_root *root, int num_bytes,
|
||||
bool enforce, bool noflush);
|
||||
/* Pre-allocated meta reservation can be freed at need */
|
||||
void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root, int num_bytes);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user