Commit 207b32fb authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 878b2787
...@@ -93,6 +93,22 @@ func mkfile(parent nodefs.Node, name string, child nodefs.Node) { ...@@ -93,6 +93,22 @@ func mkfile(parent nodefs.Node, name string, child nodefs.Node) {
} }
// mount is like nodefs.MountRoot but allows to pass in full fuse.MountOptions.
func mount(mntpt string, root nodefs.Node, opts *fuse.MountOptions) (*fuse.Server, *nodefs.FileSystemConnector, error) {
nodefsOpts := nodefs.NewOptions()
nodefsOpts.Debug = opts.Debug
fsconn := nodefs.NewFileSystemConnector(root, nodefsOpts)
fssrv, err := fuse.NewServer(fsconn.RawFS(), mntpt, opts)
if err != nil {
return nil, nil, err
}
return fssrv, fsconn, nil
}
// typeOf returns ZODB type of an object. // typeOf returns ZODB type of an object.
// //
// it differs from %T in fmt in that it supports printing zodb.Broken with // it differs from %T in fmt in that it supports printing zodb.Broken with
......
...@@ -587,12 +587,18 @@ func main() { ...@@ -587,12 +587,18 @@ func main() {
// mount root // mount root
opts := nodefs.NewOptions() opts := &fuse.MountOptions{
opts.Debug = *debug FsName: "wcfs", // XXX recheck
Name: "abc", // XXX recheck
DisableXAttrs: true, // we don't use
Debug: *debug,
}
root := nodefs.NewDefaultNode() root := nodefs.NewDefaultNode()
server, fsconn, err := nodefs.MountRoot(mntpt, root, opts) fssrv, fsconn, err := mount(mntpt, root, opts)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
...@@ -610,5 +616,5 @@ func main() { ...@@ -610,5 +616,5 @@ func main() {
_ = autoexit _ = autoexit
// serve client requests // serve client requests
server.Serve() // XXX Serve returns no error fssrv.Serve() // XXX Serve returns no error
} }
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