vfs: Add FlushDirCache method

This commit is contained in:
Nick Craig-Wood 2017-11-18 11:59:01 +00:00
parent a5b034a992
commit 9738f8532b

View File

@ -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 { func (vfs *VFS) CleanUp() error {
return vfs.cache.cleanUp() return vfs.cache.cleanUp()
} }
// FlushDirCache empties the directory cache
func (vfs *VFS) FlushDirCache() {
vfs.root.ForgetAll()
}
// WaitForWriters sleeps until all writers have finished or // WaitForWriters sleeps until all writers have finished or
// time.Duration has elapsed // time.Duration has elapsed