Commit 06d6949d authored by Jakob Unterwurzacher's avatar Jakob Unterwurzacher Committed by Han-Wen Nienhuys

loopback example: Set fsname to original dir, name to "loopbackfs"

"df -T" output:

Before:

  Filesystem                 Type                   1K-blocks      Used  Available Use% Mounted on
  pathfs.pathInode           fuse.pathfs.pathInode    4015252   3219628     795624  81% /tmp/mountpoint

After:

  Filesystem                 Type             1K-blocks      Used  Available Use% Mounted on
  /tmp/original              fuse.loopbackfs    4015252   3219620     795632  81% /tmp/mountpoint
parent 324ea173
......@@ -7,6 +7,7 @@ import (
"flag"
"fmt"
"os"
"path/filepath"
"time"
"github.com/hanwen/go-fuse/fuse"
......@@ -40,8 +41,11 @@ func main() {
pathFs := pathfs.NewPathNodeFs(finalFs, nil)
conn := nodefs.NewFileSystemConnector(pathFs.Root(), opts)
mountPoint := flag.Arg(0)
origAbs, _ := filepath.Abs(orig)
mOpts := &fuse.MountOptions{
AllowOther: *other,
Name: "loopbackfs",
FsName: origAbs,
}
state, err := fuse.NewServer(conn.RawFS(), mountPoint, mOpts)
if err != nil {
......
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