From c7eb2ba8684eccafd60d5a29ac7560380c215da6 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sat, 26 Oct 2024 12:06:56 +0200 Subject: [PATCH] fuse: remove locking in doInit The _OP_INIT opcode is handled synchronously, so it does not have to synchronize with other goroutines. Change-Id: I6cc20e86d348b1680287811618d67778f399ca34 --- fuse/opcode.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fuse/opcode.go b/fuse/opcode.go index f7cca99d..089ab911 100644 --- a/fuse/opcode.go +++ b/fuse/opcode.go @@ -98,7 +98,7 @@ func doInit(server *Server, req *request) { } kernelFlags := input.Flags64() - server.reqMu.Lock() + server.kernelSettings = *input kernelFlags &= (CAP_ASYNC_READ | CAP_BIG_WRITES | CAP_FILE_OPS | CAP_READDIRPLUS | CAP_NO_OPEN_SUPPORT | CAP_PARALLEL_DIROPS | CAP_MAX_PAGES | CAP_RENAME_SWAP | CAP_PASSTHROUGH) @@ -141,7 +141,6 @@ func doInit(server *Server, req *request) { // memory pages (usually 4kiB). Linux v4.19 and older ignore this and always use // 128kiB. maxPages := (server.opts.MaxWrite-1)/syscall.Getpagesize() + 1 // Round up - server.reqMu.Unlock() out := (*InitOut)(req.outData()) *out = InitOut{