From ded980eb3fadd79f73a1254e6b26551c4d6c8ab9 Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Wed, 22 May 2024 09:26:44 +0100 Subject: btrfs: add and use helper to commit the current transaction We have several places that attach to the current transaction with btrfs_attach_transaction_barrier() and then commit the transaction if there is one. Add a helper and use it to deduplicate this pattern. Reviewed-by: Josef Bacik Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- fs/btrfs/transaction.h | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/btrfs/transaction.h') diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index 90b987941dd1..81da655b5ee7 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h @@ -268,6 +268,7 @@ void btrfs_maybe_wake_unfinished_drop(struct btrfs_fs_info *fs_info); int btrfs_clean_one_deleted_snapshot(struct btrfs_fs_info *fs_info); int btrfs_commit_transaction(struct btrfs_trans_handle *trans); void btrfs_commit_transaction_async(struct btrfs_trans_handle *trans); +int btrfs_commit_current_transaction(struct btrfs_root *root); int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans); bool btrfs_should_end_transaction(struct btrfs_trans_handle *trans); void btrfs_throttle(struct btrfs_fs_info *fs_info); -- cgit v1.2.3