Skip to content

Commit

Permalink
Add PARALLEL_DIROPS FUSE option to jacobsa/fuse
Browse files Browse the repository at this point in the history
  • Loading branch information
sethiay committed Apr 4, 2024
1 parent 2b0495a commit eada4af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ func (c *Connection) Init() error {
initOp.Flags |= fusekernel.InitNoOpendirSupport
}

// Tell the Kernel to allow sending parallel lookup and readdir operations.
if c.cfg.EnableParallelDirOps {
initOp.Flags |= fusekernel.InitParallelDirOps
}

return c.Reply(ctx, nil)
}

Expand Down
1 change: 1 addition & 0 deletions internal/fusekernel/fuse_kernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ const (
InitAsyncDIO InitFlags = 1 << 15
InitWritebackCache InitFlags = 1 << 16
InitNoOpenSupport InitFlags = 1 << 17
InitParallelDirOps InitFlags = 1 << 18
InitMaxPages InitFlags = 1 << 22
InitCacheSymlinks InitFlags = 1 << 23
InitNoOpendirSupport InitFlags = 1 << 24
Expand Down
5 changes: 5 additions & 0 deletions mount_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ type MountConfig struct {
// Flag to enable async reads that are received from
// the kernel
EnableAsyncReads bool

// Flag to enable parallel lookup and readdir operations from the
// kernel
// Ref: https://github.com/torvalds/linux/commit/5c672ab3f0ee0f78f7acad183f34db0f8781a200
EnableParallelDirOps bool
}

// Create a map containing all of the key=value mount options to be given to
Expand Down

0 comments on commit eada4af

Please sign in to comment.