diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindfs.1 | 13 | ||||
-rw-r--r-- | src/bindfs.c | 7 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/bindfs.1 b/src/bindfs.1 index 7cb13d0..3c2f92b 100644 --- a/src/bindfs.1 +++ b/src/bindfs.1 @@ -410,12 +410,17 @@ otherwise thread-safe, there is currently a race condition that may pose a security risk for some use cases. See \fB\%BUGS\fP below. .TP +.B \-\-direct\-io, \-o direct\-io + +Forwards each read/write operation 1:1 to the underlying FS, +disabling batching and caching by the kernel. Some applications may +require this, however it may be incompatible with other applications, +as currently it has issues with \fBmmap\fP(2) calls, at least. + +.TP .B \-\-no\-direct\-io, \-o no\-direct\-io -By default, each read/write operation is forwarded 1:1 to the underlying FS, -disabling batching and caching by the kernel. Specify this option for default -FUSE behaviour, which may be more performant with some applications but -incompatible with others. +This option is provided in case the default changes in the future. .TP .B \-\-forward\-odirect=\fIalignment\fP, \-o forward\-odirect=\fIalignment\fP diff --git a/src/bindfs.c b/src/bindfs.c index d373fc2..13695de 100644 --- a/src/bindfs.c +++ b/src/bindfs.c @@ -1801,6 +1801,7 @@ enum OptionKey { OPTKEY_HIDE_HARD_LINKS, OPTKEY_RESOLVE_SYMLINKS, OPTKEY_BLOCK_DEVICES_AS_FILES, + OPTKEY_DIRECT_IO, OPTKEY_NO_DIRECT_IO }; @@ -1910,6 +1911,9 @@ static int process_option(void *data, const char *arg, int key, settings.block_devices_as_files = 1; return 0; #ifdef __linux__ + case OPTKEY_DIRECT_IO: + settings.direct_io = true; + return 0; case OPTKEY_NO_DIRECT_IO: settings.direct_io = false; return 0; @@ -2408,6 +2412,7 @@ int main(int argc, char *argv[]) OPT2("--delete-deny", "delete-deny", OPTKEY_DELETE_DENY), OPT2("--rename-deny", "rename-deny", OPTKEY_RENAME_DENY), #ifdef __linux__ + OPT2("--direct-io", "direct-io", OPTKEY_DIRECT_IO), OPT2("--no-direct-io", "no-direct-io", OPTKEY_NO_DIRECT_IO), #endif @@ -2477,7 +2482,7 @@ int main(int argc, char *argv[]) #ifdef __linux__ settings.forward_odirect = 0; settings.odirect_alignment = 0; - settings.direct_io = true; + settings.direct_io = false; #endif atexit(&atexit_func); |