From 1b498ac9b341e086562f54cc49bf035e19a94e1d Mon Sep 17 00:00:00 2001 From: Amir Goldstein Date: Sun, 24 Oct 2021 14:01:23 +0300 Subject: 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 --- example/passthrough_hp.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'example') 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 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); } -- cgit v1.2.3