diff mbox series

[5/5] btrfs: remove unused alloc and free helpers for block group reserves

Message ID d78707a5750fa78939eb6509cabf962d1ab8e6ca.1695408280.git.dsterba@suse.com (mailing list archive)
State New, archived
Headers show
Series Siwtch to on-stack variables for block reserves | expand

Commit Message

David Sterba Sept. 22, 2023, 7:10 p.m. UTC
There are no remaining users of btrfs_alloc_block_rsv() and
btrfs_free_block_rsv() after conversions to on-stack or embedded
variables, so remove them.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/block-rsv.c | 22 ----------------------
 fs/btrfs/block-rsv.h |  4 ----
 2 files changed, 26 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/block-rsv.c b/fs/btrfs/block-rsv.c
index ceb5f586a2d5..9cb32301e92a 100644
--- a/fs/btrfs/block-rsv.c
+++ b/fs/btrfs/block-rsv.c
@@ -190,28 +190,6 @@  void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info,
 					    BTRFS_BLOCK_GROUP_METADATA);
 }
 
-struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info,
-					      enum btrfs_rsv_type type)
-{
-	struct btrfs_block_rsv *block_rsv;
-
-	block_rsv = kmalloc(sizeof(*block_rsv), GFP_NOFS);
-	if (!block_rsv)
-		return NULL;
-
-	btrfs_init_metadata_block_rsv(fs_info, block_rsv, type);
-	return block_rsv;
-}
-
-void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info,
-			  struct btrfs_block_rsv *rsv)
-{
-	if (!rsv)
-		return;
-	btrfs_block_rsv_release(fs_info, rsv, (u64)-1, NULL);
-	kfree(rsv);
-}
-
 int btrfs_block_rsv_add(struct btrfs_fs_info *fs_info,
 			struct btrfs_block_rsv *block_rsv, u64 num_bytes,
 			enum btrfs_reserve_flush_enum flush)
diff --git a/fs/btrfs/block-rsv.h b/fs/btrfs/block-rsv.h
index b0bd12b8652f..f1f52a21682a 100644
--- a/fs/btrfs/block-rsv.h
+++ b/fs/btrfs/block-rsv.h
@@ -53,13 +53,9 @@  struct btrfs_block_rsv {
 
 void btrfs_init_block_rsv(struct btrfs_block_rsv *rsv, enum btrfs_rsv_type type);
 void btrfs_init_root_block_rsv(struct btrfs_root *root);
-struct btrfs_block_rsv *btrfs_alloc_block_rsv(struct btrfs_fs_info *fs_info,
-					      enum btrfs_rsv_type type);
 void btrfs_init_metadata_block_rsv(struct btrfs_fs_info *fs_info,
 				   struct btrfs_block_rsv *rsv,
 				   enum btrfs_rsv_type type);
-void btrfs_free_block_rsv(struct btrfs_fs_info *fs_info,
-			  struct btrfs_block_rsv *rsv);
 int btrfs_block_rsv_add(struct btrfs_fs_info *fs_info,
 			struct btrfs_block_rsv *block_rsv, u64 num_bytes,
 			enum btrfs_reserve_flush_enum flush);