From 22741f5582ea003c3518aff76e8df6561403f88b Mon Sep 17 00:00:00 2001 From: Bernd Schubert Date: Mon, 4 Dec 2023 15:58:45 +0100 Subject: Add FUSE_CAP_DIRECT_IO_ALLOW_MMAP and use in passthrough_hp This is not called FUSE_CAP_DIRECT_IO_RELAX, as the kernel flag FUSE_DIRECT_IO_RELAX is supposed to be renamed to FUSE_DIRECT_IO_ALLOW_MMAP. The corresponding kernel patches just did not land yet. --- lib/fuse_lowlevel.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/fuse_lowlevel.c') diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index ea98536..41e626b 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2019,6 +2019,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) bufsize = max_bufsize; } } + if (inargflags & FUSE_DIRECT_IO_ALLOW_MMAP) + se->conn.capable |= FUSE_CAP_DIRECT_IO_ALLOW_MMAP; if (arg->minor >= 38) se->conn.capable |= FUSE_CAP_EXPIRE_ONLY; } else { @@ -2151,6 +2153,8 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) outargflags |= FUSE_EXPLICIT_INVAL_DATA; if (se->conn.want & FUSE_CAP_SETXATTR_EXT) outargflags |= FUSE_SETXATTR_EXT; + if (se->conn.want & FUSE_CAP_DIRECT_IO_ALLOW_MMAP) + outargflags |= FUSE_DIRECT_IO_ALLOW_MMAP; if (inargflags & FUSE_INIT_EXT) { outargflags |= FUSE_INIT_EXT; -- cgit v1.2.3