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 --- lib/fuse_lowlevel.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index d227688..b5638fc 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -395,6 +395,8 @@ static void fill_open(struct fuse_open_out *arg, arg->open_flags |= FOPEN_CACHE_DIR; if (f->nonseekable) arg->open_flags |= FOPEN_NONSEEKABLE; + if (f->noflush) + arg->open_flags |= FOPEN_NOFLUSH; } int fuse_reply_entry(fuse_req_t req, const struct fuse_entry_param *e) -- cgit v1.2.3