Revised a plan.

geesefs-0-30-9
Aaron Jacobs 2015-03-30 16:20:02 +11:00
parent 8e8c391a21
commit 42cefe94f7
1 changed files with 26 additions and 3 deletions

View File

@ -14,7 +14,10 @@
package forgetfs
import "github.com/jacobsa/fuse"
import (
"github.com/jacobsa/fuse"
"github.com/jacobsa/fuse/fuseutil"
)
// Create a file system whose sole contents are a file named "foo" and a
// directory named "bar".
@ -30,15 +33,27 @@ import "github.com/jacobsa/fuse"
// there are no inodes with non-zero reference counts remaining, after
// unmounting.
func NewFileSystem() (fs *ForgetFS) {
fs = &ForgetFS{}
impl := &fsImpl{}
fs = &ForgetFS{
impl: impl,
server: fuseutil.NewFileSystemServer(impl),
}
return
}
////////////////////////////////////////////////////////////////////////
// ForgetFS
////////////////////////////////////////////////////////////////////////
type ForgetFS struct {
impl *fsImpl
server fuse.Server
}
func (fs *ForgetFS) ServeOps(c *fuse.Connection) {
panic("TODO: Export dispatch function from fuseutil and use it here.")
fs.server.ServeOps(c)
}
// Panic if there are any inodes that have a non-zero reference count. For use
@ -46,3 +61,11 @@ func (fs *ForgetFS) ServeOps(c *fuse.Connection) {
func (fs *ForgetFS) Check() {
panic("TODO")
}
////////////////////////////////////////////////////////////////////////
// Actual implementation
////////////////////////////////////////////////////////////////////////
type fsImpl struct {
fuseutil.NotImplementedFileSystem
}