summaryrefslogtreecommitdiff
path: root/fs/bcachefs/io.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-10-29 15:54:17 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:09:45 -0400
commit1df3e19996a3b29ed82315bf03cb02ac4e4e70ab (patch)
tree745b9032df5c61f7b371071cbfd62622a8e4258c /fs/bcachefs/io.h
parenta10195764901e0a41e64d596de57a957e7f982f0 (diff)
downloadlwn-1df3e19996a3b29ed82315bf03cb02ac4e4e70ab.tar.gz
lwn-1df3e19996a3b29ed82315bf03cb02ac4e4e70ab.zip
bcachefs: BCH_WRITE_SYNC
This adds a new flag for the write path, BCH_WRITE_SYNC, and switches the O_DIRECT write path to use it when we're not running asynchronously. It runs the btree update after the write in the original thread's context instead of a kworker, cutting context switches in half. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/io.h')
-rw-r--r--fs/bcachefs/io.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/io.h b/fs/bcachefs/io.h
index 730c7a5bcce8..9322484135f9 100644
--- a/fs/bcachefs/io.h
+++ b/fs/bcachefs/io.h
@@ -39,6 +39,7 @@ enum bch_write_flags {
__BCH_WRITE_WROTE_DATA_INLINE,
__BCH_WRITE_FROM_INTERNAL,
__BCH_WRITE_CHECK_ENOSPC,
+ __BCH_WRITE_SYNC,
__BCH_WRITE_MOVE,
__BCH_WRITE_IN_WORKER,
__BCH_WRITE_DONE,
@@ -55,6 +56,7 @@ enum bch_write_flags {
#define BCH_WRITE_WROTE_DATA_INLINE (1U << __BCH_WRITE_WROTE_DATA_INLINE)
#define BCH_WRITE_FROM_INTERNAL (1U << __BCH_WRITE_FROM_INTERNAL)
#define BCH_WRITE_CHECK_ENOSPC (1U << __BCH_WRITE_CHECK_ENOSPC)
+#define BCH_WRITE_SYNC (1U << __BCH_WRITE_SYNC)
#define BCH_WRITE_MOVE (1U << __BCH_WRITE_MOVE)
/* Internal: */