Commit ae9d3bcc authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Fix the examples.

parent 9c09165d
...@@ -45,7 +45,7 @@ func main() { ...@@ -45,7 +45,7 @@ func main() {
gofs := unionfs.NewAutoUnionFs(flag.Arg(1), options) gofs := unionfs.NewAutoUnionFs(flag.Arg(1), options)
state, conn, err := fuse.MountFileSystem(flag.Arg(0), gofs, nil) state, conn, err := fuse.MountPathFileSystem(flag.Arg(0), gofs, nil)
if err != nil { if err != nil {
fmt.Printf("Mount fail: %v\n", err) fmt.Printf("Mount fail: %v\n", err)
os.Exit(1) os.Exit(1)
......
...@@ -52,7 +52,7 @@ func main() { ...@@ -52,7 +52,7 @@ func main() {
if len(flag.Args()) < 1 { if len(flag.Args()) < 1 {
log.Fatal("Usage:\n hello MOUNTPOINT") log.Fatal("Usage:\n hello MOUNTPOINT")
} }
state, _, err := fuse.MountFileSystem(flag.Arg(0), &HelloFs{}, nil) state, _, err := fuse.MountPathFileSystem(flag.Arg(0), &HelloFs{}, nil)
if err != nil { if err != nil {
log.Fatal("Mount fail: %v\n", err) log.Fatal("Mount fail: %v\n", err)
} }
......
...@@ -52,7 +52,7 @@ func main() { ...@@ -52,7 +52,7 @@ func main() {
finalFs = debugFs finalFs = debugFs
} }
conn := fuse.NewFileSystemConnector(finalFs, opts) conn := fuse.NewFileSystemConnector(fuse.NewPathNodeFs(finalFs), opts)
var finalRawFs fuse.RawFileSystem = conn var finalRawFs fuse.RawFileSystem = conn
if *latencies { if *latencies {
rawTiming := fuse.NewTimingRawFileSystem(conn) rawTiming := fuse.NewTimingRawFileSystem(conn)
......
...@@ -22,7 +22,7 @@ func main() { ...@@ -22,7 +22,7 @@ func main() {
} }
fs := zipfs.NewMultiZipFs() fs := zipfs.NewMultiZipFs()
state, _, err := fuse.MountFileSystem(flag.Arg(0), fs, nil) state, _, err := fuse.MountPathFileSystem(flag.Arg(0), fs, nil)
if err != nil { if err != nil {
fmt.Printf("Mount fail: %v\n", err) fmt.Printf("Mount fail: %v\n", err)
os.Exit(1) os.Exit(1)
......
...@@ -34,7 +34,7 @@ func main() { ...@@ -34,7 +34,7 @@ func main() {
log.Fatal("Cannot create UnionFs", err) log.Fatal("Cannot create UnionFs", err)
os.Exit(1) os.Exit(1)
} }
mountState, _, err := fuse.MountFileSystem(flag.Arg(0), ufs, nil) mountState, _, err := fuse.MountPathFileSystem(flag.Arg(0), ufs, nil)
if err != nil { if err != nil {
log.Fatal("Mount fail:", err) log.Fatal("Mount fail:", err)
} }
......
...@@ -22,29 +22,19 @@ func main() { ...@@ -22,29 +22,19 @@ func main() {
os.Exit(2) os.Exit(2)
} }
var fs fuse.FileSystem var fs fuse.NodeFileSystem
fs, err := zipfs.NewArchiveFileSystem(flag.Arg(1)) fs, err := zipfs.NewArchiveFileSystem(flag.Arg(1))
if err != nil { if err != nil {
fmt.Fprintf(os.Stderr, "NewArchiveFileSystem failed: %v\n", err) fmt.Fprintf(os.Stderr, "NewArchiveFileSystem failed: %v\n", err)
os.Exit(1) os.Exit(1)
} }
debugFs := fuse.NewFileSystemDebug()
if *latencies { state, _, err := fuse.MountNodeFileSystem(flag.Arg(0), fs, nil)
debugFs.FileSystem = fs
fs = debugFs
}
state, _, err := fuse.MountFileSystem(flag.Arg(0), fs, nil)
if err != nil { if err != nil {
fmt.Printf("Mount fail: %v\n", err) fmt.Printf("Mount fail: %v\n", err)
os.Exit(1) os.Exit(1)
} }
if *latencies {
debugFs.AddMountState(state)
}
state.SetRecordStatistics(*latencies) state.SetRecordStatistics(*latencies)
state.Debug = *debug state.Debug = *debug
state.Loop(true) state.Loop(true)
......
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