Skip to content

Commit

Permalink
fuse: remove locking in doInit
Browse files Browse the repository at this point in the history
The _OP_INIT opcode is handled synchronously, so it does not have to
synchronize with other goroutines.

Change-Id: I6cc20e86d348b1680287811618d67778f399ca34
  • Loading branch information
hanwen committed Oct 27, 2024
1 parent 8e89237 commit c7eb2ba
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fuse/opcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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{
Expand Down

0 comments on commit c7eb2ba

Please sign in to comment.