From fce970c313bf25ba9ae5b6a335e3293736df3d48 Mon Sep 17 00:00:00 2001 From: yangyun Date: Fri, 23 Feb 2024 11:06:08 +0800 Subject: passthrough_example: make parallel_direct_writes more clearly Move the parallel_direct_writes enable action to the init function in high level API, it is more recommended just like commit 8ee553dac. Besides, add some comments to show that the feature parallel_direct_writes is depend on the feature direct_io (refer to kernel side patch series to consolidate direct IO, link: https://lwn.net/ml/linux-fsdevel/ 20230918150313.3845114-1-bschubert@ddn.com for the reason). --- example/passthrough_hp.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'example/passthrough_hp.cc') diff --git a/example/passthrough_hp.cc b/example/passthrough_hp.cc index 66fe6f8..9b17de0 100644 --- a/example/passthrough_hp.cc +++ b/example/passthrough_hp.cc @@ -840,6 +840,9 @@ static void sfs_create(fuse_req_t req, fuse_ino_t parent, const char *name, if (fs.direct_io) fi->direct_io = 1; + /* parallel_direct_writes feature depends on direct_io features. + To make parallel_direct_writes valid, need set fi->direct_io + in current function. */ fi->parallel_direct_writes = 1; Inode& inode = get_inode(e.ino); @@ -902,6 +905,9 @@ static void sfs_open(fuse_req_t req, fuse_ino_t ino, fuse_file_info *fi) { if (fs.direct_io) fi->direct_io = 1; + /* parallel_direct_writes feature depends on direct_io features. + To make parallel_direct_writes valid, need set fi->direct_io + in current function. */ fi->parallel_direct_writes = 1; fi->fh = fd; -- cgit v1.2.3