Skip to content

Commit eada4af

Browse files
committed
Add PARALLEL_DIROPS FUSE option to jacobsa/fuse
1 parent 2b0495a commit eada4af

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

connection.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ func (c *Connection) Init() error {
193193
initOp.Flags |= fusekernel.InitNoOpendirSupport
194194
}
195195

196+
// Tell the Kernel to allow sending parallel lookup and readdir operations.
197+
if c.cfg.EnableParallelDirOps {
198+
initOp.Flags |= fusekernel.InitParallelDirOps
199+
}
200+
196201
return c.Reply(ctx, nil)
197202
}
198203

internal/fusekernel/fuse_kernel.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ const (
266266
InitAsyncDIO InitFlags = 1 << 15
267267
InitWritebackCache InitFlags = 1 << 16
268268
InitNoOpenSupport InitFlags = 1 << 17
269+
InitParallelDirOps InitFlags = 1 << 18
269270
InitMaxPages InitFlags = 1 << 22
270271
InitCacheSymlinks InitFlags = 1 << 23
271272
InitNoOpendirSupport InitFlags = 1 << 24

mount_config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ type MountConfig struct {
185185
// Flag to enable async reads that are received from
186186
// the kernel
187187
EnableAsyncReads bool
188+
189+
// Flag to enable parallel lookup and readdir operations from the
190+
// kernel
191+
// Ref: https://github.com/torvalds/linux/commit/5c672ab3f0ee0f78f7acad183f34db0f8781a200
192+
EnableParallelDirOps bool
188193
}
189194

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

0 commit comments

Comments
 (0)