File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -208,8 +208,10 @@ func (c *Connection) Init() error {
208208 // Enable Readdirplus support, allowing the kernel to use Readdirplus
209209 initOp .Flags |= fusekernel .InitDoReaddirplus
210210
211- // Enable adaptive Readdirplus, allowing the kernel to choose between Readdirplus and Readdir
212- initOp .Flags |= fusekernel .InitReaddirplusAuto
211+ if c .cfg .EnableAutoReaddirplus {
212+ // Enable adaptive Readdirplus, allowing the kernel to choose between Readdirplus and Readdir
213+ initOp .Flags |= fusekernel .InitReaddirplusAuto
214+ }
213215 }
214216
215217 return c .Reply (ctx , nil )
Original file line number Diff line number Diff line change @@ -210,6 +210,18 @@ type MountConfig struct {
210210 // by returning not just the directory entries (like ReadDir), but also their inode
211211 // attributes, thereby saving one extra Lookup request per directory entry.
212212 EnableReaddirplus bool
213+
214+ // Flag to enable adaptive ReadDirPlus.
215+ // This is only effective if EnableReaddirplus is true.
216+ //
217+ // When both flags are set, the kernel may dynamically choose between issuing
218+ // ReaddirPlus and Readdir requests based on observed access patterns.
219+ // For example, `ls` (which lists filenames only) may fall back to Readdir after an initial ReaddirPlus,
220+ // whereas `ls -l` is more likely to continue using ReaddirPlus.
221+ //
222+ // If EnableReaddirplus is true and this flag is false, the kernel will always
223+ // use ReaddirPlus for directory listing.
224+ EnableAutoReaddirplus bool
213225}
214226
215227type FUSEImpl uint8
You can’t perform that action at this time.
0 commit comments