aboutsummaryrefslogtreecommitdiff
path: root/weed/command
diff options
context:
space:
mode:
authoreddy-gfx <86091021+gfxlabs@users.noreply.github.com>2022-02-27 04:52:08 -0600
committerGitHub <noreply@github.com>2022-02-27 04:52:08 -0600
commitfb940dd807e47e6c4f86af9d59869f346997b137 (patch)
tree63b909be07b030f878a77d258a2deb92deb69ff7 /weed/command
parent881a0fe8068cc197378967527663500161f2ff20 (diff)
parent22362f64958f8587992f98eb2f7fac95fd204516 (diff)
downloadseaweedfs-fb940dd807e47e6c4f86af9d59869f346997b137.tar.xz
seaweedfs-fb940dd807e47e6c4f86af9d59869f346997b137.zip
Merge branch 'chrislusf:master' into acl-pr
Diffstat (limited to 'weed/command')
-rw-r--r--weed/command/mount2_std.go33
1 files changed, 28 insertions, 5 deletions
diff --git a/weed/command/mount2_std.go b/weed/command/mount2_std.go
index 9f87b35b5..61555d8f2 100644
--- a/weed/command/mount2_std.go
+++ b/weed/command/mount2_std.go
@@ -155,13 +155,36 @@ func RunMount2(option *Mount2Options, umask os.FileMode) bool {
Name: "seaweedfs",
SingleThreaded: false,
DisableXAttrs: false,
- Debug: false, // *option.debug,
+ Debug: *option.debug,
EnableLocks: false,
ExplicitDataCacheControl: false,
- // SyncRead: false, // set to false to enable the FUSE_CAP_ASYNC_READ capability
- DirectMount: true,
- DirectMountFlags: 0,
- // EnableAcl: false,
+ DirectMount: true,
+ DirectMountFlags: 0,
+ //SyncRead: false, // set to false to enable the FUSE_CAP_ASYNC_READ capability
+ //EnableAcl: true,
+ }
+ if *option.nonempty {
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "nonempty")
+ }
+ if *option.readOnly {
+ if runtime.GOOS == "darwin" {
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "rdonly")
+ } else {
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "ro")
+ }
+ }
+ if runtime.GOOS == "darwin" {
+ // https://github-wiki-see.page/m/macfuse/macfuse/wiki/Mount-Options
+ ioSizeMB := 1
+ for ioSizeMB*2 <= *option.chunkSizeLimitMB && ioSizeMB*2 <= 32 {
+ ioSizeMB *= 2
+ }
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "daemon_timeout=600")
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "noapplexattr")
+ // fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache") // need to test effectiveness
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "slow_statfs")
+ fuseMountOptions.Options = append(fuseMountOptions.Options, "volname="+*option.filer)
+ fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))
}
// find mount point