From 91f1b9fdd2c02a7375e46bb2628870f3c6116072 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 21 Jul 2022 15:41:29 -0400 Subject: 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 --- fs/bcachefs/opts.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'fs/bcachefs/opts.h') diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index 30cf9a2d9dc1..6e2bd6e01f8c 100644 --- a/fs/bcachefs/opts.h +++ b/fs/bcachefs/opts.h @@ -346,6 +346,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), \ -- cgit v1.2.3