From eb2172f63fcdf7f5455c142daaceb6b1a489f7f4 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 27 Oct 2019 09:12:10 -0700 Subject: [PATCH] FUSE: add os specific mount options related to https://github.com/chrislusf/seaweedfs/issues/1094 --- weed/command/mount_darwin.go | 10 ++++++++++ weed/command/mount_freebsd.go | 10 ++++++++++ weed/command/mount_linux.go | 12 ++++++++++++ weed/command/mount_notsupported.go | 1 + weed/command/mount_std.go | 5 ++++- 5 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 weed/command/mount_darwin.go create mode 100644 weed/command/mount_freebsd.go create mode 100644 weed/command/mount_linux.go diff --git a/weed/command/mount_darwin.go b/weed/command/mount_darwin.go new file mode 100644 index 000000000..5b3fff513 --- /dev/null +++ b/weed/command/mount_darwin.go @@ -0,0 +1,10 @@ +package command + +import ( + + "github.com/seaweedfs/fuse" +) + +func osSpecificMountOptions() []fuse.MountOption { + return []fuse.MountOption{} +} diff --git a/weed/command/mount_freebsd.go b/weed/command/mount_freebsd.go new file mode 100644 index 000000000..5b3fff513 --- /dev/null +++ b/weed/command/mount_freebsd.go @@ -0,0 +1,10 @@ +package command + +import ( + + "github.com/seaweedfs/fuse" +) + +func osSpecificMountOptions() []fuse.MountOption { + return []fuse.MountOption{} +} diff --git a/weed/command/mount_linux.go b/weed/command/mount_linux.go new file mode 100644 index 000000000..f07e5bfe8 --- /dev/null +++ b/weed/command/mount_linux.go @@ -0,0 +1,12 @@ +package command + +import ( + + "github.com/seaweedfs/fuse" +) + +func osSpecificMountOptions() []fuse.MountOption { + return []fuse.MountOption{ + fuse.AllowNonEmptyMount(), + } +} diff --git a/weed/command/mount_notsupported.go b/weed/command/mount_notsupported.go index 3bf22ddc4..f3c0de3d6 100644 --- a/weed/command/mount_notsupported.go +++ b/weed/command/mount_notsupported.go @@ -1,5 +1,6 @@ // +build !linux // +build !darwin +// +build !freebsd package command diff --git a/weed/command/mount_std.go b/weed/command/mount_std.go index 0519ae7b8..6ca9bfdca 100644 --- a/weed/command/mount_std.go +++ b/weed/command/mount_std.go @@ -1,4 +1,4 @@ -// +build linux darwin +// +build linux darwin freebsd package command @@ -107,6 +107,9 @@ func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCente fuse.WritebackCache(), fuse.AllowNonEmptyMount(), } + + options = append(options, osSpecificMountOptions()...) + if allowOthers { options = append(options, fuse.AllowOther()) }