Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

FUSE: add os specific mount options

Chris Lueb2172f63fcd
diff --git a/weed/command/mount_darwin.go b/weed/command/mount_darwin.go
new file mode 100644
index 0000000000..5b3fff5130
--- /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 0000000000..5b3fff5130
--- /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 0000000000..f07e5bfe83
--- /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 3bf22ddc42..f3c0de3d67 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 0519ae7b87..6ca9bfdcab 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())
}