aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2022-04-03 16:52:14 +0300
committerMartin Pärtel <martin.partel@gmail.com>2022-04-03 16:52:14 +0300
commit57d9c9407ec04d2c08323acda87597882f4901cf (patch)
tree0c0cbb8d0851f9aa8b464d7b304cbe545b064eb0 /src
parentd7d0dc47f03762f5fcd92bbe8c2221ea6b3fa642 (diff)
downloadbindfs-57d9c9407ec04d2c08323acda87597882f4901cf.tar.gz
Made direct-io the default after all, and added --no-direct-io.
#110
Diffstat (limited to 'src')
-rw-r--r--src/bindfs.113
-rw-r--r--src/bindfs.c10
2 files changed, 12 insertions, 11 deletions
diff --git a/src/bindfs.1 b/src/bindfs.1
index db2e4fe..ea77cf8 100644
--- a/src/bindfs.1
+++ b/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
diff --git a/src/bindfs.c b/src/bindfs.c
index fd09704..332999b 100644
--- a/src/bindfs.c
+++ b/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);