On 2021/2/23 上午12:40, Nikolay Borisov wrote:
Signed-off-by: Nikolay Borisov <nbori...@suse.com>

Considering how small the export is, I prefer this to be merged with
next patch, as it's much easier to understand why we want to export the
function.

And since it will be exported, may be it's a good idea to rename it as
btrfs_qgroup_reserve_meta_atomic() or btrfs_qgroup_reserve_meta_noflush()?

Thanks,
Qu
---
  fs/btrfs/qgroup.c | 4 ++--
  fs/btrfs/qgroup.h | 3 +++
  2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index 808370ada888..fbef95bc3557 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -3841,8 +3841,8 @@ static int sub_root_meta_rsv(struct btrfs_root *root, int 
num_bytes,
        return num_bytes;
  }

-static int qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
-                               enum btrfs_qgroup_rsv_type type, bool enforce)
+int qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
+                       enum btrfs_qgroup_rsv_type type, bool enforce)
  {
        struct btrfs_fs_info *fs_info = root->fs_info;
        int ret;
diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h
index 50dea9a2d8fb..c1a3cc15dede 100644
--- a/fs/btrfs/qgroup.h
+++ b/fs/btrfs/qgroup.h
@@ -354,6 +354,9 @@ int btrfs_verify_qgroup_counts(struct btrfs_fs_info 
*fs_info, u64 qgroupid,
                               u64 rfer, u64 excl);
  #endif

+int qgroup_reserve_meta(struct btrfs_root *root, int num_bytes,
+                       enum btrfs_qgroup_rsv_type type, bool enforce);
+
  /* New io_tree based accurate qgroup reserve API */
  int btrfs_qgroup_reserve_data(struct btrfs_inode *inode,
                        struct extent_changeset **reserved, u64 start, u64 len);

Reply via email to