summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2022-07-21 15:41:29 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2022-08-07 14:36:24 -0400
commite9f93182d0a0f127921932a8ea054463e8373eaa (patch)
tree67a351dd5ff86018fa26756c20bc213acc376e0f
parent29944eb7d59f43147fc6729b0cb8b88f1b750fb5 (diff)
bcachefs: Add an O_DIRECT option (for userspace)
Sometimes we see IO errors due to O_DIRECT alignment issues - having an option to use buffered IO will be helpful. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r--fs/bcachefs/opts.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h
index 2f5f49cb774d..5b8586ecb374 100644
--- a/fs/bcachefs/opts.h
+++ b/fs/bcachefs/opts.h
@@ -341,6 +341,11 @@ enum opt_type {
OPT_BOOL(), \
BCH2_NO_SB_OPT, false, \
NULL, "Don't open device in exclusive mode") \
+ x(direct_io, u8, \
+ OPT_FS|OPT_MOUNT, \
+ OPT_BOOL(), \
+ BCH2_NO_SB_OPT, true, \
+ NULL, "Use O_DIRECT (userspace only)") \
x(sb, u64, \
OPT_MOUNT, \
OPT_UINT(0, S64_MAX), \