From: Filipe Manana Date: Tue, 17 Mar 2026 19:09:15 +0000 (+0000) Subject: btrfs: collapse __btrfs_qgroup_free_meta() into btrfs_qgroup_free_meta_prealloc() X-Git-Tag: v7.1-rc1~231^2~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5adf3f32c0b3adc65dc8ab889bcfc109a450c6fa;p=thirdparty%2Fkernel%2Flinux.git btrfs: collapse __btrfs_qgroup_free_meta() into btrfs_qgroup_free_meta_prealloc() Since __btrfs_qgroup_free_meta() is only called by btrfs_qgroup_free_meta_prealloc(), which is a simple inline wrapper, get rid of the later and rename __btrfs_qgroup_free_meta() to the later. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c index 65ec458595071..8a9039fba1582 100644 --- a/fs/btrfs/qgroup.c +++ b/fs/btrfs/qgroup.c @@ -4551,8 +4551,7 @@ void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root) BTRFS_QGROUP_RSV_META_PERTRANS); } -void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes, - enum btrfs_qgroup_rsv_type type) +void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root, int num_bytes) { struct btrfs_fs_info *fs_info = root->fs_info; @@ -4565,10 +4564,13 @@ void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes, * which can lead to underflow. * Here ensure we will only free what we really have reserved. */ - num_bytes = sub_root_meta_rsv(root, num_bytes, type); + num_bytes = sub_root_meta_rsv(root, num_bytes, + BTRFS_QGROUP_RSV_META_PREALLOC); BUG_ON(num_bytes != round_down(num_bytes, fs_info->nodesize)); - trace_btrfs_qgroup_meta_reserve(root, -(s64)num_bytes, type); - btrfs_qgroup_free_refroot(fs_info, btrfs_root_id(root), num_bytes, type); + trace_btrfs_qgroup_meta_reserve(root, -(s64)num_bytes, + BTRFS_QGROUP_RSV_META_PREALLOC); + btrfs_qgroup_free_refroot(fs_info, btrfs_root_id(root), num_bytes, + BTRFS_QGROUP_RSV_META_PREALLOC); } static void qgroup_convert_meta(struct btrfs_fs_info *fs_info, u64 ref_root, diff --git a/fs/btrfs/qgroup.h b/fs/btrfs/qgroup.h index 419f3c4120cef..190efe3ca64b1 100644 --- a/fs/btrfs/qgroup.h +++ b/fs/btrfs/qgroup.h @@ -407,16 +407,8 @@ static inline int btrfs_qgroup_reserve_meta_prealloc(struct btrfs_root *root, enforce, noflush); } -void __btrfs_qgroup_free_meta(struct btrfs_root *root, int num_bytes, - enum btrfs_qgroup_rsv_type type); - /* Pre-allocated meta reservation can be freed at need */ -static inline void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root, - int num_bytes) -{ - __btrfs_qgroup_free_meta(root, num_bytes, - BTRFS_QGROUP_RSV_META_PREALLOC); -} +void btrfs_qgroup_free_meta_prealloc(struct btrfs_root *root, int num_bytes); void btrfs_qgroup_free_meta_all_pertrans(struct btrfs_root *root); void btrfs_qgroup_convert_reserved_meta(struct btrfs_root *root, int num_bytes);