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{}
|
||||
go longnameCacheCleaner()
|
||||
}
|
||||
|
@ -47,6 +47,8 @@ var _ pathfs.FileSystem = &reverseFS{}
|
||||
|
||||
// NewFS returns an encrypted FUSE overlay filesystem
|
||||
func NewFS(args fusefrontend.Args) pathfs.FileSystem {
|
||||
initLongnameCache()
|
||||
|
||||
cryptoCore := cryptocore.New(args.Masterkey, args.CryptoBackend, contentenc.DefaultIVBits)
|
||||
contentEnc := contentenc.New(cryptoCore, contentenc.DefaultBS)
|
||||
nameTransform := nametransform.New(cryptoCore, args.LongNames)
|
||||
|
Loading…
Reference in New Issue
Block a user