Allow the user to set arbitrary mount options.

For GoogleCloudPlatform/gcsfuse#50.
geesefs-0-30-9
Aaron Jacobs 2015-05-19 11:39:18 +10:00
parent b65f337637
commit 1d03f1695d
1 changed files with 13 additions and 0 deletions

View File

@ -89,6 +89,14 @@ type MountConfig struct {
// the value of ChildInodeEntry.EntryExpiration is ignored by the kernel, and
// entries will be cached for an arbitrarily long time.
EnableVnodeCaching bool
// Additional key=value options to pass unadulterated to the underlying mount
// command. See `man 8 mount`, the fuse documentation, etc. for
// system-specific information.
//
// For expert use only! May invalidate other guarantees made in the
// documentation for this package.
Options map[string]string
}
// Convert to mount options to be passed to package bazilfuse.
@ -123,6 +131,11 @@ func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) {
opts = append(opts, bazilfuse.SetOption("noappledouble", ""))
}
// Last but not least: other user-supplied options.
for k, v := range c.Options {
opts = append(opts, bazilfuse.SetOption(k, v))
}
return
}