diff options
author | sunwire <50745572+sunwire@users.noreply.github.com> | 2019-10-19 20:26:10 +0100 |
---|---|---|
committer | Nikolaus Rath <Nikolaus@rath.org> | 2019-10-19 20:26:10 +0100 |
commit | e1a9050c61bba5b51e21dbf8e80020c5c1d7c9ba (patch) | |
tree | 1f6bb1f9746044bcc23a25d2e3d7f2ecdae3b730 /sshfs.c | |
parent | af63f35ac149678ac491cd763641cafaaa3bc6bd (diff) | |
download | sshfs-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.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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" |