diff options
Diffstat (limited to 'example/passthrough.c')
-rw-r--r-- | example/passthrough.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/example/passthrough.c b/example/passthrough.c index 5a0d6d7..30a8ad5 100644 --- a/example/passthrough.c +++ b/example/passthrough.c @@ -303,6 +303,14 @@ static int xmp_open(const char *path, struct fuse_file_info *fi) if (res == -1) return -errno; + /* Enable direct_io when open has flags O_DIRECT to enjoy the feature + parallel_direct_writes (i.e., to get a shared lock, not exclusive lock, + for writes to the same file). */ + if (fi->flags & O_DIRECT) { + fi->direct_io = 1; + fi->parallel_direct_writes = 1; + } + fi->fh = res; return 0; } |