geesefs-0-30-9
Aaron Jacobs 2015-03-30 16:29:21 +11:00
parent a787be87bb
commit f76439120c
1 changed files with 15 additions and 1 deletions

View File

@ -15,6 +15,8 @@
package forgetfs
import (
"fmt"
"github.com/jacobsa/fuse"
"github.com/jacobsa/fuse/fuseops"
"github.com/jacobsa/fuse/fuseutil"
@ -72,7 +74,7 @@ func (fs *ForgetFS) ServeOps(c *fuse.Connection) {
// Panic if there are any inodes that have a non-zero reference count. For use
// after unmounting.
func (fs *ForgetFS) Check() {
panic("TODO")
fs.impl.Check()
}
////////////////////////////////////////////////////////////////////////
@ -132,6 +134,18 @@ func (fs *fsImpl) checkInvariants() {
}
}
// LOCKS_EXCLUDED(fs.mu)
func (fs *fsImpl) Check() {
fs.mu.Lock()
defer fs.mu.Unlock()
for k, v := range fs.inodes {
if v.lookupCount != 0 {
panic(fmt.Sprintf("Inode %v has lookup count %v", k, v.lookupCount))
}
}
}
func (fs *fsImpl) Init(
op *fuseops.InitOp) {
var err error