From e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba Mon Sep 17 00:00:00 2001 From: sunwire <50745572+sunwire@users.noreply.github.com> Date: Sat, 19 Oct 2019 20:26:10 +0100 Subject: Added direct_io option (#173) --- sshfs.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sshfs.c') 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" -- cgit v1.2.3