From 2d10e03395734e0124e19ab846399d93fc3dee23 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 15:03:11 +1100 Subject: [PATCH 1/4] Switched import paths to the bazilfuse fork. --- errors.go | 2 +- file_system.go | 2 +- mounted_file_system.go | 2 +- samples/memfs/memfs_test.go | 2 +- server.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/errors.go b/errors.go index 044edd6..8bbd7ca 100644 --- a/errors.go +++ b/errors.go @@ -17,7 +17,7 @@ package fuse import ( "syscall" - bazilfuse "bazil.org/fuse" + "github.com/jacobsa/bazilfuse" ) const ( diff --git a/file_system.go b/file_system.go index 5d50c71..7f9f849 100644 --- a/file_system.go +++ b/file_system.go @@ -19,7 +19,7 @@ import ( "os" "time" - bazilfuse "bazil.org/fuse" + "github.com/jacobsa/bazilfuse" "golang.org/x/net/context" ) diff --git a/mounted_file_system.go b/mounted_file_system.go index 963c514..586ba13 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -17,7 +17,7 @@ package fuse import ( "errors" - bazilfuse "bazil.org/fuse" + "github.com/jacobsa/bazilfuse" "golang.org/x/net/context" ) diff --git a/samples/memfs/memfs_test.go b/samples/memfs/memfs_test.go index cecd9b6..6351234 100644 --- a/samples/memfs/memfs_test.go +++ b/samples/memfs/memfs_test.go @@ -27,7 +27,7 @@ import ( "testing" "time" - bazilfuse "bazil.org/fuse" + "github.com/jacobsa/bazilfuse" "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/fusetesting" "github.com/jacobsa/fuse/samples/memfs" diff --git a/server.go b/server.go index 173df74..67fcba1 100644 --- a/server.go +++ b/server.go @@ -22,7 +22,7 @@ import ( "golang.org/x/net/context" - bazilfuse "bazil.org/fuse" + "github.com/jacobsa/bazilfuse" ) // An object that terminates one end of the userspace <-> FUSE VFS connection. From 5129322fc273f0989a6d76fc9f3a231604173fd8 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 15:25:06 +1100 Subject: [PATCH 2/4] Reworked the public interface for mount options. --- mounted_file_system.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/mounted_file_system.go b/mounted_file_system.go index 586ba13..c7df5e5 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -115,13 +115,20 @@ func (mfs *MountedFileSystem) mountAndServe( close(mfs.joinStatusAvailable) } +// Optional configuration accepted by Mount. +type MountConfig struct { +} + +// Convert to mount options to be passed to package bazilfuse. +func (c *MountConfig) bazilfuseOptions() []bazilfuse.MountOption + // Attempt to mount the supplied file system on the given directory. // mfs.WaitForReady() must be called to find out whether the mount was // successful. func Mount( dir string, fs FileSystem, - options ...bazilfuse.MountOption) (mfs *MountedFileSystem, err error) { + config *MountConfig) (mfs *MountedFileSystem, err error) { // Create a server object. server, err := newServer(fs) if err != nil { @@ -136,7 +143,7 @@ func Mount( } // Mount in the background. - go mfs.mountAndServe(server, options) + go mfs.mountAndServe(server, config.bazilfuseOptions()) return } From 8adb300b78def2aae735e29f476a49cf14523c1b Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 15:25:48 +1100 Subject: [PATCH 3/4] There are no supported options for now. --- mounted_file_system.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mounted_file_system.go b/mounted_file_system.go index c7df5e5..af5e6c1 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -120,7 +120,9 @@ type MountConfig struct { } // Convert to mount options to be passed to package bazilfuse. -func (c *MountConfig) bazilfuseOptions() []bazilfuse.MountOption +func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) { + return +} // Attempt to mount the supplied file system on the given directory. // mfs.WaitForReady() must be called to find out whether the mount was From c7136958710e0a4ba0e18bce94624b573400be5c Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 15:27:40 +1100 Subject: [PATCH 4/4] Fixed broken tests using Mount. --- samples/cachingfs/caching_fs_test.go | 2 +- samples/hellofs/hello_fs_test.go | 2 +- samples/memfs/memfs_test.go | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/samples/cachingfs/caching_fs_test.go b/samples/cachingfs/caching_fs_test.go index 20e13df..d570a08 100644 --- a/samples/cachingfs/caching_fs_test.go +++ b/samples/cachingfs/caching_fs_test.go @@ -60,7 +60,7 @@ func (t *cachingFSTest) setUp( AssertEq(nil, err) // Mount it. - t.mfs, err = fuse.Mount(t.dir, t.fs) + t.mfs, err = fuse.Mount(t.dir, t.fs, &fuse.MountConfig{}) AssertEq(nil, err) err = t.mfs.WaitForReady(context.Background()) diff --git a/samples/hellofs/hello_fs_test.go b/samples/hellofs/hello_fs_test.go index a871916..fe1df85 100644 --- a/samples/hellofs/hello_fs_test.go +++ b/samples/hellofs/hello_fs_test.go @@ -65,7 +65,7 @@ func (t *HelloFSTest) SetUp(ti *TestInfo) { Clock: &t.clock, } - if t.mfs, err = fuse.Mount(mountPoint, fs); err != nil { + if t.mfs, err = fuse.Mount(mountPoint, fs, &fuse.MountConfig{}); err != nil { panic("Mount: " + err.Error()) } diff --git a/samples/memfs/memfs_test.go b/samples/memfs/memfs_test.go index 6351234..200b7ec 100644 --- a/samples/memfs/memfs_test.go +++ b/samples/memfs/memfs_test.go @@ -27,7 +27,6 @@ import ( "testing" "time" - "github.com/jacobsa/bazilfuse" "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/fusetesting" "github.com/jacobsa/fuse/samples/memfs" @@ -114,11 +113,9 @@ func (t *MemFSTest) SetUp(ti *TestInfo) { // Mount a file system. fs := memfs.NewMemFS(currentUid(), currentGid(), &t.clock) - t.mfs, err = fuse.Mount( - mountPoint, - fs, - bazilfuse.DefaultPermissions()) - + // TODO(jacobsa): Add a default_permissions field to the config and use it + // here. + t.mfs, err = fuse.Mount(mountPoint, fs, &fuse.MountConfig{}) if err != nil { panic("Mount: " + err.Error()) }