Browse Source

Made direct-io the default after all, and added --no-direct-io.

#110
pull/108/merge
Martin Pärtel 3 months ago
parent
commit
57d9c9407e
  1. 3
      ChangeLog
  2. 13
      src/bindfs.1
  3. 10
      src/bindfs.c

3
ChangeLog

@ -1,6 +1,7 @@
2022-04-03 Martin Pärtel <martin dot partel at gmail dot com>
* Added --direct-io (issue #110, thanks @DUOLabs333)
* Added --no-direct-io and enabled FUSE's direct_io by default
(issue #110, thanks @DUOLabs333)
2021-02-15 Martin Pärtel <martin dot partel at gmail dot com>

13
src/bindfs.1

@ -11,9 +11,7 @@ bindfs \(hy mount \-\-bind in user\-space
.SH DESCRIPTION
A FUSE filesystem for mirroring the contents of a directory to another
directory. Additionally, one can change the permissions
of files in the mirrored directory.
directory, with changes to permissions and other features.
.SH FILE OWNERSHIP
.TP
@ -389,9 +387,12 @@ 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
Forces each read/write operation to be forwarded 1:1 to the underlying FS,
disabling batching and caching by the kernel.
.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.
.TP
.B \-\-forward\-odirect=\fIalignment\fP, \-o forward\-odirect=\fIalignment\fP

10
src/bindfs.c

@ -1797,7 +1797,7 @@ enum OptionKey {
OPTKEY_HIDE_HARD_LINKS,
OPTKEY_RESOLVE_SYMLINKS,
OPTKEY_BLOCK_DEVICES_AS_FILES,
OPTKEY_DIRECT_IO
OPTKEY_NO_DIRECT_IO
};
static int process_option(void *data, const char *arg, int key,
@ -1905,8 +1905,8 @@ static int process_option(void *data, const char *arg, int key,
case OPTKEY_BLOCK_DEVICES_AS_FILES:
settings.block_devices_as_files = 1;
return 0;
case OPTKEY_DIRECT_IO:
settings.direct_io = true;
case OPTKEY_NO_DIRECT_IO:
settings.direct_io = false;
return 0;
case OPTKEY_NONOPTION:
if (!settings.mntsrc) {
@ -2397,7 +2397,7 @@ int main(int argc, char *argv[])
OPT2("--delete-deny", "delete-deny", OPTKEY_DELETE_DENY),
OPT2("--rename-deny", "rename-deny", OPTKEY_RENAME_DENY),
OPT2("--direct-io", "direct-io", OPTKEY_DIRECT_IO),
OPT2("--no-direct-io", "no-direct-io", OPTKEY_NO_DIRECT_IO),
OPT2("--hide-hard-links", "hide-hard-links", OPTKEY_HIDE_HARD_LINKS),
OPT2("--resolve-symlinks", "resolve-symlinks", OPTKEY_RESOLVE_SYMLINKS),
@ -2465,7 +2465,7 @@ int main(int argc, char *argv[])
#ifdef __linux__
settings.forward_odirect = 0;
settings.odirect_alignment = 0;
settings.direct_io = false;
settings.direct_io = true;
#endif
atexit(&atexit_func);

Loading…
Cancel
Save