Skip to contentSkip to conversation

btrfs: Remove unused btrfs_free_squota_rsv

PATCH In review [email protected] 2 participants 2 messages Oct 3, 2024 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 btrfs: Remove unused btrfs_free_squota_rsv

From: "Dr. David Alan Gilbert" <[email protected]>

btrfs_free_squota_rsv() was added in commit
e85a0adacf17 ("btrfs: ensure releasing squota reserve on head refs")

but has remained unused.

Remove it.

---
 fs/btrfs/qgroup.c | 11 -----------
 fs/btrfs/qgroup.h |  1 -
 2 files changed, 12 deletions(-)
fs/btrfs/qgroup.c +0 -11
index c297909f1506..52f0cf7621d6 100644
@@ -4883,17 +4883,6 @@ void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans)
 	xa_destroy(&trans->delayed_refs.dirty_extents);
 }
 
-void btrfs_free_squota_rsv(struct btrfs_fs_info *fs_info, u64 root, u64 rsv_bytes)
-{
-	if (btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_SIMPLE)
-		return;
-
-	if (!is_fstree(root))
-		return;
-
-	btrfs_qgroup_free_refroot(fs_info, root, rsv_bytes, BTRFS_QGROUP_RSV_DATA);
-}
-
 int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
 			      const struct btrfs_squota_delta *delta)
 {
fs/btrfs/qgroup.h +0 -1
index 98adf4ec7b01..d72e09de2d64 100644
@@ -440,7 +440,6 @@ int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans,
 		struct btrfs_root *root, struct extent_buffer *eb);
 void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans);
 bool btrfs_check_quota_leak(const struct btrfs_fs_info *fs_info);
-void btrfs_free_squota_rsv(struct btrfs_fs_info *fs_info, u64 root, u64 rsv_bytes);
 int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
 			      const struct btrfs_squota_delta *delta);
 
Signature · 1 line
2.46.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · 在 2024/10/4 06:03, [email protected] 写道:

From: "Dr. David Alan Gilbert" <[email protected]>

btrfs_free_squota_rsv() was added in commit
e85a0adacf17 ("btrfs: ensure releasing squota reserve on head refs")

but has remained unused.

Remove it.

Thanks,
Qu

Quoted 39 lines
---
  fs/btrfs/qgroup.c | 11 -----------
  fs/btrfs/qgroup.h |  1 -
  2 files changed, 12 deletions(-)
fs/btrfs/qgroup.c +0 -11
index c297909f1506..52f0cf7621d6 100644
@@ -4883,17 +4883,6 @@ void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans)
  	xa_destroy(&trans->delayed_refs.dirty_extents);
  }
 
-void btrfs_free_squota_rsv(struct btrfs_fs_info *fs_info, u64 root, u64 rsv_bytes)
-{
-	if (btrfs_qgroup_mode(fs_info) != BTRFS_QGROUP_MODE_SIMPLE)
-		return;
-
-	if (!is_fstree(root))
-		return;
-
-	btrfs_qgroup_free_refroot(fs_info, root, rsv_bytes, BTRFS_QGROUP_RSV_DATA);
-}
-
  int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
  			      const struct btrfs_squota_delta *delta)
  {
fs/btrfs/qgroup.h +0 -1
index 98adf4ec7b01..d72e09de2d64 100644
@@ -440,7 +440,6 @@ int btrfs_qgroup_trace_subtree_after_cow(struct btrfs_trans_handle *trans,
  		struct btrfs_root *root, struct extent_buffer *eb);
  void btrfs_qgroup_destroy_extent_records(struct btrfs_transaction *trans);
  bool btrfs_check_quota_leak(const struct btrfs_fs_info *fs_info);
-void btrfs_free_squota_rsv(struct btrfs_fs_info *fs_info, u64 root, u64 rsv_bytes);
  int btrfs_record_squota_delta(struct btrfs_fs_info *fs_info,
  			      const struct btrfs_squota_delta *delta);