example/passthrough_hp: Set keep_cache and noflush in sfs_create
authorBernd Schubert <bschubert@ddn.com>
Thu, 12 Sep 2024 14:30:43 +0000 (16:30 +0200)
committerBernd Schubert <bernd.schubert@fastmail.fm>
Fri, 13 Sep 2024 17:10:44 +0000 (19:10 +0200)
These flags should be also set for O_CREAT

example/passthrough_hp.cc

index 4f0dd5ef0a13183b0d31fa083ce71a23d3af0600..26e3644b2a062c87e533cd2aeb04a8d1f50a549a 100644 (file)
@@ -871,6 +871,9 @@ static void sfs_create_open_flags(fuse_file_info *fi)
     To make parallel_direct_writes valid, need set fi->direct_io
     in current function. */
     fi->parallel_direct_writes = 1;
+
+    fi->keep_cache = (fs.timeout != 0);
+    fi->noflush = (fs.timeout == 0 && (fi->flags & O_ACCMODE) == O_RDONLY);
 }
 
 static void sfs_create(fuse_req_t req, fuse_ino_t parent, const char *name,
@@ -956,8 +959,6 @@ 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);
 
     sfs_create_open_flags(fi);