Commit 2f654264 authored by Michael Stapelberg's avatar Michael Stapelberg
parent 7c2b5692
...@@ -149,6 +149,8 @@ func (c *Connection) Init() error { ...@@ -149,6 +149,8 @@ func (c *Connection) Init() error {
} }
cacheSymlinks := initOp.Flags&fusekernel.InitCacheSymlinks > 0 cacheSymlinks := initOp.Flags&fusekernel.InitCacheSymlinks > 0
noOpenSupport := initOp.Flags&fusekernel.InitNoOpenSupport > 0
noOpendirSupport := initOp.Flags&fusekernel.InitNoOpendirSupport > 0
// Respond to the init op. // Respond to the init op.
initOp.Library = c.protocol initOp.Library = c.protocol
...@@ -171,6 +173,18 @@ func (c *Connection) Init() error { ...@@ -171,6 +173,18 @@ func (c *Connection) Init() error {
initOp.Flags |= fusekernel.InitCacheSymlinks initOp.Flags |= fusekernel.InitCacheSymlinks
} }
// Tell the kernel to treat returning -ENOSYS on OpenFile as not needing
// OpenFile calls at all (Linux >= 3.16):
if c.cfg.EnableNoOpenSupport && noOpenSupport {
initOp.Flags |= fusekernel.InitNoOpenSupport
}
// Tell the kernel to treat returning -ENOSYS on OpenDir as not needing
// OpenDir calls at all (Linux >= 5.1):
if c.cfg.EnableNoOpendirSupport && noOpendirSupport {
initOp.Flags |= fusekernel.InitNoOpendirSupport
}
c.Reply(ctx, nil) c.Reply(ctx, nil)
return nil return nil
} }
......
...@@ -267,6 +267,7 @@ const ( ...@@ -267,6 +267,7 @@ const (
InitWritebackCache InitFlags = 1 << 16 InitWritebackCache InitFlags = 1 << 16
InitNoOpenSupport InitFlags = 1 << 17 InitNoOpenSupport InitFlags = 1 << 17
InitCacheSymlinks InitFlags = 1 << 23 InitCacheSymlinks InitFlags = 1 << 23
InitNoOpendirSupport InitFlags = 1 << 24
InitCaseSensitive InitFlags = 1 << 29 // OS X only InitCaseSensitive InitFlags = 1 << 29 // OS X only
InitVolRename InitFlags = 1 << 30 // OS X only InitVolRename InitFlags = 1 << 30 // OS X only
...@@ -298,6 +299,7 @@ var initFlagNames = []flagName{ ...@@ -298,6 +299,7 @@ var initFlagNames = []flagName{
{uint32(InitWritebackCache), "InitWritebackCache"}, {uint32(InitWritebackCache), "InitWritebackCache"},
{uint32(InitNoOpenSupport), "InitNoOpenSupport"}, {uint32(InitNoOpenSupport), "InitNoOpenSupport"},
{uint32(InitCacheSymlinks), "InitCacheSymlinks"}, {uint32(InitCacheSymlinks), "InitCacheSymlinks"},
{uint32(InitNoOpendirSupport), "InitNoOpendirSupport"},
{uint32(InitCaseSensitive), "InitCaseSensitive"}, {uint32(InitCaseSensitive), "InitCaseSensitive"},
{uint32(InitVolRename), "InitVolRename"}, {uint32(InitVolRename), "InitVolRename"},
......
...@@ -139,6 +139,18 @@ type MountConfig struct { ...@@ -139,6 +139,18 @@ type MountConfig struct {
// target. // target.
EnableSymlinkCaching bool EnableSymlinkCaching bool
// Linux only.
//
// Tell the kernel to treat returning -ENOSYS on OpenFile as not needing
// OpenFile calls at all (Linux >= 3.16):
EnableNoOpenSupport bool
// Linux only.
//
// Tell the kernel to treat returning -ENOSYS on OpenDir as not needing
// OpenDir calls at all (Linux >= 5.1):
EnableNoOpendirSupport bool
// OS X only. // OS X only.
// //
// The name of the mounted volume, as displayed in the Finder. If empty, a // The name of the mounted volume, as displayed in the Finder. If empty, a
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment