/* Should we allow read/write semantics ? */
static int read_write = 0;
+/* should we use direct_io or not? Direct i/o can not be reexported by kNFSd
+ on linux !
+*/
+static int direct_io = 0;
+
static int sigchild_initialized = 0;
static int debug_initialized = 0;
static int log_fd = -1;
int main(int argc, const char *argv[])
{
int ret;
- const char *fuse_argv[] = {
+ int num_args;
+ const char *fuse_argv[16] = {
"remote_cache",
"<export>",
"-oallow_other",
{ "debug", 'd', POPT_ARG_INT, &debug_level, 0, "debug level", "integer" },
{ "file-check-parent-mtime", 0, POPT_ARG_NONE, &file_check_parent_mtime, 0, "check mtime of remote file instead of parent directory mtime", NULL },
{ "read-write", 0, POPT_ARG_NONE, &read_write, 0, "read/write cache", NULL },
+ { "direct_io", 0, POPT_ARG_NONE, &direct_io, 0, "Use direct_io for better write performance (not kNFSd compatible)", NULL },
POPT_TABLEEND
};
printf("Remote caching of %s to temp storage %s exporting through %s\n", remote, cache, export);
- printf("here we go ...\n");
-
log_fd = creat("/var/log/log.remote-cache", 0777);
if (log_fd == -1) {
fprintf(stderr, "Could not open logfile. Aborting\n");
exit(10);
}
- return fuse_main(8, discard_const(fuse_argv), &remote_cache_ops, NULL);
+ num_args = 8;
+ if (direct_io) {
+ fuse_argv[num_args] = "-odirect_io";
+ num_args++;
+ printf("Using DIRECT_IO\n");
+ }
+
+ printf("here we go ...\n");
+ return fuse_main(num_args, discard_const(fuse_argv), &remote_cache_ops, NULL);
}