implement NoOpenSupport and NoOpendirSupport
See also:geesefs-0-30-97678ac5061
d7afaec0b5
d9a9ea94f7
parent
7c2b569250
commit
2f65426467
|
@ -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 {
|
||||||
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 (
|
||||||
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{
|
||||||
{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 {
|
||||||
// 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
|
||||||
|
|
Loading…
Reference in New Issue