Commit 34ef5c4d authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

In autounion.go add PathNodeFsOptions to AutoUnionFsOptions, and use

them for new mounts.
parent 4c9a5b84
...@@ -41,13 +41,13 @@ func main() { ...@@ -41,13 +41,13 @@ func main() {
Owner: fuse.CurrentOwner(), Owner: fuse.CurrentOwner(),
}, },
UpdateOnMount: true, UpdateOnMount: true,
} fuse.PathNodeFsOptions{
pathOptions := fuse.PathNodeFsOptions{ ClientInodes: *hardlinks,
ClientInodes: *hardlinks, }
} }
gofs := unionfs.NewAutoUnionFs(flag.Arg(1), options) gofs := unionfs.NewAutoUnionFs(flag.Arg(1), options)
pathfs := fuse.NewPathNodeFs(gofs, &pathOptions) pathfs := fuse.NewPathNodeFs(gofs, nil)
state, conn, err := fuse.MountNodeFileSystem(flag.Arg(0), pathfs, nil) state, conn, err := fuse.MountNodeFileSystem(flag.Arg(0), pathfs, nil)
if err != nil { if err != nil {
fmt.Printf("Mount fail: %v\n", err) fmt.Printf("Mount fail: %v\n", err)
......
...@@ -38,6 +38,7 @@ type AutoUnionFs struct { ...@@ -38,6 +38,7 @@ type AutoUnionFs struct {
type AutoUnionFsOptions struct { type AutoUnionFsOptions struct {
UnionFsOptions UnionFsOptions
fuse.FileSystemOptions fuse.FileSystemOptions
fuse.PathNodeFsOptions
// If set, run updateKnownFses() after mounting. // If set, run updateKnownFses() after mounting.
UpdateOnMount bool UpdateOnMount bool
...@@ -110,7 +111,7 @@ func (me *AutoUnionFs) createFs(name string, roots []string) fuse.Status { ...@@ -110,7 +111,7 @@ func (me *AutoUnionFs) createFs(name string, roots []string) fuse.Status {
} }
log.Printf("Adding workspace %v for roots %v", name, ufs.Name()) log.Printf("Adding workspace %v for roots %v", name, ufs.Name())
nfs := fuse.NewPathNodeFs(ufs, nil) nfs := fuse.NewPathNodeFs(ufs, &me.options.PathNodeFsOptions)
code := me.nodeFs.Mount(name, nfs, &me.options.FileSystemOptions) code := me.nodeFs.Mount(name, nfs, &me.options.FileSystemOptions)
if code.Ok() { if code.Ok() {
me.knownFileSystems[name] = knownFs{ me.knownFileSystems[name] = knownFs{
......
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