reverse: initialize the longname cache only when reverse mode is used
Gets rid of the idling longnameCacheCleaner thread in "normal" mode.
This commit is contained in:
parent
a4956fa6bf
commit
ff48dc1aab
@ -30,7 +30,10 @@ func longnameCacheCleaner() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func initLongnameCache() {
|
||||||
|
if longnameParentCache != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
longnameParentCache = map[string]string{}
|
longnameParentCache = map[string]string{}
|
||||||
go longnameCacheCleaner()
|
go longnameCacheCleaner()
|
||||||
}
|
}
|
||||||
|
@ -47,6 +47,8 @@ var _ pathfs.FileSystem = &reverseFS{}
|
|||||||
|
|
||||||
// NewFS returns an encrypted FUSE overlay filesystem
|
// NewFS returns an encrypted FUSE overlay filesystem
|
||||||
func NewFS(args fusefrontend.Args) pathfs.FileSystem {
|
func NewFS(args fusefrontend.Args) pathfs.FileSystem {
|
||||||
|
initLongnameCache()
|
||||||
|
|
||||||
cryptoCore := cryptocore.New(args.Masterkey, args.CryptoBackend, contentenc.DefaultIVBits)
|
cryptoCore := cryptocore.New(args.Masterkey, args.CryptoBackend, contentenc.DefaultIVBits)
|
||||||
contentEnc := contentenc.New(cryptoCore, contentenc.DefaultBS)
|
contentEnc := contentenc.New(cryptoCore, contentenc.DefaultBS)
|
||||||
nameTransform := nametransform.New(cryptoCore, args.LongNames)
|
nameTransform := nametransform.New(cryptoCore, args.LongNames)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user