From: Kent Overstreet Date: Thu, 21 Jul 2022 19:41:29 +0000 (-0400) Subject: bcachefs: Add an O_DIRECT option (for userspace) X-Git-Tag: v6.7-rc1~201^2~857 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91f1b9fdd2c02a7375e46bb2628870f3c6116072;p=thirdparty%2Fkernel%2Flinux.git 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 --- diff --git a/fs/bcachefs/opts.h b/fs/bcachefs/opts.h index 30cf9a2d9dc1a..6e2bd6e01f8cc 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), \