aboutsummaryrefslogtreecommitdiffstats
path: root/example/passthrough_hp.cc
diff options
context:
space:
mode:
authorAmir Goldstein <amir73il@gmail.com>2021-10-24 14:01:23 +0300
committerAmir Goldstein <amir73il@gmail.com>2022-01-03 14:55:34 +0200
commit1b498ac9b341e086562f54cc49bf035e19a94e1d (patch)
tree51745ff21733bd4a3dc3328df272f57404b60f4b /example/passthrough_hp.cc
parent48ae2e72b39b6a31cb2194f6f11786b7ca06aac6 (diff)
downloadlibfuse-1b498ac9b341e086562f54cc49bf035e19a94e1d.tar.gz
Add support for FOPEN_NOFLUSH flag
Allow requesting from kernel to avoid flush on close at file open time. If kernel does not support FOPEN_NOFLUSH flag, the request will be ignored. For passthrough_hp example, request to avoid flush on close when writeback cache is disabled and file is opened O_RDONLY. Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Diffstat (limited to 'example/passthrough_hp.cc')
-rw-r--r--example/passthrough_hp.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc
index 872fc73..e15f893 100644
--- a/example/passthrough_hp.cc
+++ b/example/passthrough_hp.cc
@@ -856,6 +856,7 @@ static void sfs_open(fuse_req_t req, fuse_ino_t ino, fuse_file_info *fi) {
lock_guard<mutex> g {inode.m};
inode.nopen++;
fi->keep_cache = (fs.timeout != 0);
+ fi->noflush = (fs.timeout == 0 && (fi->flags & O_ACCMODE) == O_RDONLY);
fi->fh = fd;
fuse_reply_open(req, fi);
}