aboutsummaryrefslogtreecommitdiff
path: root/sshfs.c
diff options
context:
space:
mode:
authorsunwire <50745572+sunwire@users.noreply.github.com>2019-10-19 20:26:10 +0100
committerNikolaus Rath <Nikolaus@rath.org>2019-10-19 20:26:10 +0100
commite1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba (patch)
tree1f6bb1f9746044bcc23a25d2e3d7f2ecdae3b730 /sshfs.c
parentaf63f35ac149678ac491cd763641cafaaa3bc6bd (diff)
downloadsshfs-e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba.tar
sshfs-e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba.tar.gz
sshfs-e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba.tar.bz2
sshfs-e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba.zip
Added direct_io option (#173)
Diffstat (limited to 'sshfs.c')
-rw-r--r--sshfs.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sshfs.c b/sshfs.c
index 33d23d8..a3dba80 100644
--- a/sshfs.c
+++ b/sshfs.c
@@ -244,6 +244,7 @@ struct sshfs {
int sync_write;
int sync_read;
int sync_readdir;
+ int direct_io;
int debug;
int verbose;
int foreground;
@@ -410,6 +411,7 @@ static struct fuse_opt sshfs_opts[] = {
SSHFS_OPT("disable_hardlink", disable_hardlink, 1),
SSHFS_OPT("dir_cache=yes", dir_cache, 1),
SSHFS_OPT("dir_cache=no", dir_cache, 0),
+ SSHFS_OPT("direct_io", direct_io, 1),
SSHFS_OPT("-h", show_help, 1),
SSHFS_OPT("--help", show_help, 1),
@@ -2516,6 +2518,9 @@ static int sshfs_open_common(const char *path, mode_t mode,
if (sshfs.dir_cache)
wrctr = cache_get_write_ctr();
+ if (sshfs.direct_io)
+ fi->direct_io = 1;
+
if ((fi->flags & O_ACCMODE) == O_RDONLY)
pflags = SSH_FXF_READ;
else if((fi->flags & O_ACCMODE) == O_WRONLY)
@@ -3377,6 +3382,7 @@ static void usage(const char *progname)
" -o dcache_min_clean_interval=N\n"
" sets the interval for forced cleaning of the\n"
" cache if full (default: 5)\n"
+" -o direct_io enable direct i/o\n"
" -o workaround=LIST colon separated list of workarounds\n"
" none no workarounds enabled\n"
" [no]rename fix renaming to existing file (default: off)\n"