aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/transaction.h
diff options
context:
space:
mode:
authorGravatar Takashi Iwai <tiwai@suse.de> 2018-04-25 10:41:08 +0200
committerGravatar Takashi Iwai <tiwai@suse.de> 2018-04-25 16:44:36 +0200
commit4d31c6e41ed2f95f97a19766812797dabd82a5ee (patch)
treee1f81f4f0108ff86f85b8e17b025b21609aec7b2 /fs/btrfs/transaction.h
parentALSA: hda - Sanity check of access to SPDIF controls array (diff)
parentALSA: hda - Skip jack and others for non-existing PCM streams (diff)
downloadlinux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.tar.gz
linux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.tar.bz2
linux-4d31c6e41ed2f95f97a19766812797dabd82a5ee.zip
Merge branch 'for-linus' into for-next
Back-merge 4.17-rc3 fixes for further development. This will bump the base to 4.17-rc2, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r--fs/btrfs/transaction.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h
index c88fccd80bc5..d8c0826bc2c7 100644
--- a/fs/btrfs/transaction.h
+++ b/fs/btrfs/transaction.h
@@ -199,6 +199,20 @@ int btrfs_clean_one_deleted_snapshot(struct btrfs_root *root);
int btrfs_commit_transaction(struct btrfs_trans_handle *trans);
int btrfs_commit_transaction_async(struct btrfs_trans_handle *trans,
int wait_for_unblock);
+
+/*
+ * Try to commit transaction asynchronously, so this is safe to call
+ * even holding a spinlock.
+ *
+ * It's done by informing transaction_kthread to commit transaction without
+ * waiting for commit interval.
+ */
+static inline void btrfs_commit_transaction_locksafe(
+ struct btrfs_fs_info *fs_info)
+{
+ set_bit(BTRFS_FS_NEED_ASYNC_COMMIT, &fs_info->flags);
+ wake_up_process(fs_info->transaction_kthread);
+}
int btrfs_end_transaction_throttle(struct btrfs_trans_handle *trans);
int btrfs_should_end_transaction(struct btrfs_trans_handle *trans);
void btrfs_throttle(struct btrfs_fs_info *fs_info);