]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: collapse __btrfs_qgroup_free_meta() into btrfs_qgroup_free_meta_prealloc()
authorFilipe Manana <fdmanana@suse.com>
Tue, 17 Mar 2026 19:09:15 +0000 (19:09 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 7 Apr 2026 16:56:04 +0000 (18:56 +0200)
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 <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>
fs/btrfs/qgroup.c
fs/btrfs/qgroup.h

index 65ec458595071895ece96d3e585fb157ab5669d4..8a9039fba15824e62de3dd21ef29fd0a380e8b6b 100644 (file)
@@ -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,
index 419f3c4120cef4518fff7c01dd3a96b8a642e159..190efe3ca64b18a983b0844f946e73476c9d8c49 100644 (file)
@@ -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);