Commit b65f3376 authored by Aaron Jacobs's avatar Aaron Jacobs

Allow setting a file system name.

parent 54cb69c5
......@@ -65,6 +65,11 @@ type MountConfig struct {
// should inherit. If nil, context.Background() will be used.
OpContext context.Context
// If non-empty, the name of the file system as displayed by e.g. `mount`.
// This is important because the `umount` command requires root privileges if
// it doesn't agree with /etc/fstab.
FSName string
// Mount the file system in read-only mode. File modes will appear as normal,
// but opening a file for writing and metadata operations like chmod,
// chtimes, etc. will fail.
......@@ -94,6 +99,11 @@ func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) {
// InodeAttributes.Mode.
opts = append(opts, bazilfuse.SetOption("default_permissions", ""))
// Special file system name?
if c.FSName != "" {
opts = append(opts, bazilfuse.FSName(c.FSName))
}
// Read only?
if c.ReadOnly {
opts = append(opts, bazilfuse.ReadOnly())
......
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