listen for metadata updates

This commit is contained in:
chrislu
2022-02-14 01:09:31 -08:00
parent 7286e525ad
commit dbeeda8123
17 changed files with 499 additions and 40 deletions

View File

@@ -1,5 +1,10 @@
package mount
import (
"context"
"github.com/chrislusf/seaweedfs/weed/util"
)
// Forget is called when the kernel discards entries from its
// dentry cache. This happens on unmount, and when the kernel
// is short on memory. Since it is not guaranteed to occur at
@@ -57,5 +62,7 @@ Side effects: increments the lookup count on success
*/
func (wfs *WFS) Forget(nodeid, nlookup uint64) {
wfs.inodeToPath.Forget(nodeid, nlookup)
wfs.inodeToPath.Forget(nodeid, nlookup, func(dir util.FullPath) {
wfs.metaCache.DeleteFolderChildren(context.Background(), dir)
})
}