From 9738f8532bc218a3dd55b7a4bb4fb4709a87681c Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Sat, 18 Nov 2017 11:59:01 +0000 Subject: [PATCH] vfs: Add FlushDirCache method --- vfs/vfs.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vfs/vfs.go b/vfs/vfs.go index 858ea6ae6..14e646a25 100644 --- a/vfs/vfs.go +++ b/vfs/vfs.go @@ -243,11 +243,15 @@ func (vfs *VFS) Shutdown() { } } -// CleanUp deletes the contents of the cache +// CleanUp deletes the contents of the on disk cache func (vfs *VFS) CleanUp() error { return vfs.cache.cleanUp() } +// FlushDirCache empties the directory cache +func (vfs *VFS) FlushDirCache() { + vfs.root.ForgetAll() +} // WaitForWriters sleeps until all writers have finished or // time.Duration has elapsed