From 9cc2a6f450e2a6e4f89eeca0780794bca6341f4c Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 9 Jun 2015 11:10:39 +1000 Subject: [PATCH] Implemented Destroy for forgetfs. --- samples/forgetfs/forget_fs.go | 11 +++++++++++ 1 file changed, 11 insertions(+) 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() + } +}