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

example: loopback: add -directmount, -directmountstrict flags

Allows to enable the DirectMount{,Strict} flag through the cli,
facilitating testing.

Change-Id: I46e273ea68e6a81b4e7873802bc3b1c7760f56f0
parent 56d54486
......@@ -48,6 +48,8 @@ func main() {
other := flag.Bool("allow-other", false, "mount with -o allowother.")
quiet := flag.Bool("q", false, "quiet")
ro := flag.Bool("ro", false, "mount read-only")
directmount := flag.Bool("directmount", false, "try to call the mount syscall instead of executing fusermount")
directmountstrict := flag.Bool("directmountstrict", false, "like directmount, but don't fall back to fusermount")
cpuprofile := flag.String("cpuprofile", "", "write cpu profile to this file")
memprofile := flag.String("memprofile", "", "write memory profile to this file")
flag.Parse()
......@@ -99,10 +101,12 @@ func main() {
NullPermissions: true, // Leave file permissions on "000" files as-is
MountOptions: fuse.MountOptions{
AllowOther: *other,
Debug: *debug,
FsName: orig, // First column in "df -T": original dir
Name: "loopback", // Second column in "df -T" will be shown as "fuse." + Name
AllowOther: *other,
Debug: *debug,
DirectMount: *directmount,
DirectMountStrict: *directmountstrict,
FsName: orig, // First column in "df -T": original dir
Name: "loopback", // Second column in "df -T" will be shown as "fuse." + Name
},
}
if opts.AllowOther {
......
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