diff --git a/samples/forgetfs/forget_fs.go b/samples/forgetfs/forget_fs.go index ecdee79..d0b934b 100644 --- a/samples/forgetfs/forget_fs.go +++ b/samples/forgetfs/forget_fs.go @@ -164,6 +164,11 @@ func (in *inode) DecrementLookupCount(n uint64) { in.lookupCount -= n } +// Decrement the lookup count to zero. +func (in *inode) Destroy() { + in.DecrementLookupCount(in.lookupCount) +} + //////////////////////////////////////////////////////////////////////// // Helpers //////////////////////////////////////////////////////////////////////// @@ -372,3 +377,9 @@ func (fs *fsImpl) OpenDir( return } + +func (fs *fsImpl) Destroy() { + for _, in := range fs.inodes { + in.Destroy() + } +}