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

Allow arbitrary options to be passed to fusermount.

parent 941be276
...@@ -111,6 +111,9 @@ type FileSystemOptions struct { ...@@ -111,6 +111,9 @@ type FileSystemOptions struct {
type MountOptions struct { type MountOptions struct {
AllowOther bool AllowOther bool
// Options are passed as -o string to fusermount.
Options []string
// Default is _DEFAULT_BACKGROUND_TASKS, 12. // Default is _DEFAULT_BACKGROUND_TASKS, 12.
MaxBackground int MaxBackground int
} }
......
...@@ -3,6 +3,7 @@ package fuse ...@@ -3,6 +3,7 @@ package fuse
import ( import (
"log" "log"
"os" "os"
"strings"
"syscall" "syscall"
"time" "time"
"unsafe" "unsafe"
...@@ -55,12 +56,12 @@ func (me *MountState) Mount(mountPoint string, opts *MountOptions) os.Error { ...@@ -55,12 +56,12 @@ func (me *MountState) Mount(mountPoint string, opts *MountOptions) os.Error {
} }
me.opts = opts me.opts = opts
optStr := "" optStrs := opts.Options
if opts.AllowOther { if opts.AllowOther {
optStr = "allow_other" optStrs = append(optStrs, "allow_other")
} }
file, mp, err := mount(mountPoint, optStr) file, mp, err := mount(mountPoint, strings.Join(optStrs, ","))
if err != nil { if err != nil {
return err return err
} }
......
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