From 6f93f4eba94c4962b056987b430a34d3339c53ea Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Mon, 2 Mar 2015 14:14:02 +1100 Subject: [PATCH] Implemented NewMemFS. --- samples/memfs/fs.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/samples/memfs/fs.go b/samples/memfs/fs.go index 0feac15..95524b6 100644 --- a/samples/memfs/fs.go +++ b/samples/memfs/fs.go @@ -44,6 +44,15 @@ type memFS struct { // Create a file system that stores data and metadata in memory. func NewMemFS( - clock timeutil.Clock) fuse.FileSystem { - panic("TODO(jacobsa): Implement NewMemFS.") + clock timeutil.Clock) (fs fuse.FileSystem) { + fs = &memFS{ + clock: clock, + } + + fs.(*memFS).mu = syncutil.NewInvariantMutex(fs.(*memFS).checkInvariants) + return +} + +func (fs *memFS) checkInvariants() { + panic("TODO") }