Commit 4cf05ec3 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Remove MountPathFileSystem.

parent 5d8ba04f
......@@ -72,7 +72,8 @@ func NewStatFs() *StatFs {
func setupFs(fs fuse.FileSystem, opts *fuse.FileSystemOptions) (string, func()) {
mountPoint, _ := ioutil.TempDir("", "stat_test")
state, _, err := fuse.MountPathFileSystem(mountPoint, fs, opts)
nfs := fuse.NewPathNodeFs(fs, nil)
state, _, err := fuse.MountNodeFileSystem(mountPoint, nfs, opts)
if err != nil {
panic(fmt.Sprintf("cannot mount %v", err)) // ugh - benchmark has no error methods.
}
......
......@@ -52,7 +52,8 @@ func main() {
if len(flag.Args()) < 1 {
log.Fatal("Usage:\n hello MOUNTPOINT")
}
state, _, err := fuse.MountPathFileSystem(flag.Arg(0), &HelloFs{}, nil)
nfs := fuse.NewPathNodeFs(&HelloFs{}, nil)
state, _, err := fuse.MountNodeFileSystem(flag.Arg(0), nfs, nil)
if err != nil {
log.Fatal("Mount fail: %v\n", err)
}
......
......@@ -22,7 +22,8 @@ func main() {
}
fs := zipfs.NewMultiZipFs()
state, _, err := fuse.MountPathFileSystem(flag.Arg(0), fs, nil)
nfs := fuse.NewPathNodeFs(fs, nil)
state, _, err := fuse.MountNodeFileSystem(flag.Arg(0), nfs, nil)
if err != nil {
fmt.Printf("Mount fail: %v\n", err)
os.Exit(1)
......
......@@ -136,6 +136,12 @@ type FileSystem interface {
StatFs(name string) *StatfsOut
}
type PathNodeFsOptions struct {
// If ClientInodes is set, use Inode returned from GetAttr to
// find hard-linked files.
ClientInodes bool
}
// A File object should be returned from FileSystem.Open and
// FileSystem.Create. Include DefaultFile into the struct to inherit
// a default null implementation.
......
......@@ -122,7 +122,8 @@ func TestNonseekable(t *testing.T) {
dir, err := ioutil.TempDir("", "go-fuse")
CheckSuccess(err)
defer os.RemoveAll(dir)
state, _, err := MountPathFileSystem(dir, fs, nil)
nfs := NewPathNodeFs(fs, nil)
state, _, err := MountNodeFileSystem(dir, nfs, nil)
CheckSuccess(err)
state.Debug = VerboseTest()
defer state.Unmount()
......
......@@ -122,7 +122,8 @@ func NewFile() *MutableDataFile {
func setupFAttrTest(t *testing.T, fs FileSystem) (dir string, clean func()) {
dir, err := ioutil.TempDir("", "go-fuse")
CheckSuccess(err)
state, _, err := MountPathFileSystem(dir, fs, nil)
nfs := NewPathNodeFs(fs, nil)
state, _, err := MountNodeFileSystem(dir, nfs, nil)
CheckSuccess(err)
state.Debug = VerboseTest()
......
......@@ -13,8 +13,3 @@ func MountNodeFileSystem(mountpoint string, nodeFs NodeFileSystem, opts *FileSys
}
return mountState, conn, nil
}
func MountPathFileSystem(mountpoint string, pathFs FileSystem, opts *FileSystemOptions) (*MountState, *FileSystemConnector, error) {
nfs := NewPathNodeFs(pathFs, nil)
return MountNodeFileSystem(mountpoint, nfs, opts)
}
......@@ -757,7 +757,8 @@ func TestOriginalIsSymlink(t *testing.T) {
CheckSuccess(err)
fs := NewLoopbackFileSystem(link)
state, _, err := MountPathFileSystem(mnt, fs, nil)
nfs := NewPathNodeFs(fs, nil)
state, _, err := MountNodeFileSystem(mnt, nfs, nil)
CheckSuccess(err)
defer state.Unmount()
......
......@@ -29,7 +29,8 @@ func setupOwnerTest(opts *FileSystemOptions) (workdir string, cleanup func()) {
wd, err := ioutil.TempDir("", "go-fuse")
fs := &ownerFs{}
state, _, err := MountPathFileSystem(wd, fs, opts)
nfs := NewPathNodeFs(fs, nil)
state, _, err := MountNodeFileSystem(wd, nfs, opts)
CheckSuccess(err)
go state.Loop()
return wd, func() {
......
......@@ -41,11 +41,6 @@ type PathNodeFs struct {
options *PathNodeFsOptions
}
type PathNodeFsOptions struct {
// If ClientInodes is set, use Inode returned from GetAttr to
// find hard-linked files.
ClientInodes bool
}
func (me *PathNodeFs) Mount(path string, nodeFs NodeFileSystem, opts *FileSystemOptions) Status {
dir, name := filepath.Split(path)
......
......@@ -98,7 +98,8 @@ func TestXAttrRead(t *testing.T) {
CheckSuccess(err)
defer os.RemoveAll(mountPoint)
state, _, err := MountPathFileSystem(mountPoint, xfs, nil)
nfs := NewPathNodeFs(xfs, nil)
state, _, err := MountNodeFileSystem(mountPoint, nfs, nil)
CheckSuccess(err)
state.Debug = VerboseTest()
defer state.Unmount()
......
......@@ -42,7 +42,9 @@ func setup(t *testing.T) (workdir string, cleanup func()) {
WriteFile(wd+"/ro/file2", "file2")
fs := NewAutoUnionFs(wd+"/store", testAOpts)
state, conn, err := fuse.MountPathFileSystem(wd+"/mnt", fs, &testAOpts.FileSystemOptions)
nfs := fuse.NewPathNodeFs(fs, nil)
state, conn, err := fuse.MountNodeFileSystem(wd+"/mnt", nfs, &testAOpts.FileSystemOptions)
CheckSuccess(err)
state.Debug = fuse.VerboseTest()
conn.Debug = fuse.VerboseTest()
......
......@@ -876,7 +876,8 @@ func TestUnionFsDisappearing(t *testing.T) {
NegativeTimeout: entryTtl,
}
state, _, err := fuse.MountPathFileSystem(wd+"/mnt", ufs, opts)
nfs := fuse.NewPathNodeFs(ufs, nil)
state, _, err := fuse.MountNodeFileSystem(wd+"/mnt", nfs, opts)
CheckSuccess(err)
defer state.Unmount()
state.Debug = fuse.VerboseTest()
......
......@@ -16,7 +16,8 @@ const testTtl = 0.1
func setupMzfs() (mountPoint string, cleanup func()) {
fs := NewMultiZipFs()
mountPoint, _ = ioutil.TempDir("", "")
state, _, err := fuse.MountPathFileSystem(mountPoint, fs, &fuse.FileSystemOptions{
nfs := fuse.NewPathNodeFs(fs)
state, _, err := fuse.MountNodeFileSystem(mountPoint, nfs, &fuse.FileSystemOptions{
EntryTimeout: testTtl,
AttrTimeout: testTtl,
NegativeTimeout: 0.0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment