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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
fuse: add FUSE performance options to weed fuse command (#7925)
Chris Lu5a135f8c5a46
diff --git a/weed/command/fuse_std.go b/weed/command/fuse_std.goindex bd274f651b..29628a8ef0 100644--- a/weed/command/fuse_std.go+++ b/weed/command/fuse_std.go@@ -224,6 +224,36 @@ func runFuse(cmd *Command, args []string) bool {fusermountPath = parameter.valuecase "config_dir":util.ConfigurationFileDirectory.Set(parameter.value)+ // FUSE performance options+ case "writebackCache":+ if parsed, err := strconv.ParseBool(parameter.value); err == nil {+ mountOptions.writebackCache = &parsed+ } else {+ fmt.Fprintf(os.Stderr, "failed to parse 'writebackCache' value %q: %v\n", parameter.value, err)+ return false+ }+ case "asyncDio":+ if parsed, err := strconv.ParseBool(parameter.value); err == nil {+ mountOptions.asyncDio = &parsed+ } else {+ fmt.Fprintf(os.Stderr, "failed to parse 'asyncDio' value %q: %v\n", parameter.value, err)+ return false+ }+ case "cacheSymlink":+ if parsed, err := strconv.ParseBool(parameter.value); err == nil {+ mountOptions.cacheSymlink = &parsed+ } else {+ fmt.Fprintf(os.Stderr, "failed to parse 'cacheSymlink' value %q: %v\n", parameter.value, err)+ return false+ }+ // macOS-specific FUSE options+ case "sys.novncache":+ if parsed, err := strconv.ParseBool(parameter.value); err == nil {+ mountOptions.novncache = &parsed+ } else {+ fmt.Fprintf(os.Stderr, "failed to parse 'sys.novncache' value %q: %v\n", parameter.value, err)+ return false+ }default:t := parameter.nameif parameter.value != "true" {diff --git a/weed/command/mount_std.go b/weed/command/mount_std.goindex 497a1eec82..a4cbfe820b 100644--- a/weed/command/mount_std.go+++ b/weed/command/mount_std.go@@ -208,7 +208,7 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {if runtime.GOARCH == "amd64" {fuseMountOptions.Options = append(fuseMountOptions.Options, "noapplexattr")}- if *option.novncache {+ if option.novncache != nil && *option.novncache {fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache")}fuseMountOptions.Options = append(fuseMountOptions.Options, "slow_statfs")@@ -216,13 +216,13 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))}- if *option.writebackCache {+ if option.writebackCache != nil && *option.writebackCache {fuseMountOptions.Options = append(fuseMountOptions.Options, "writeback_cache")}- if *option.asyncDio {+ if option.asyncDio != nil && *option.asyncDio {fuseMountOptions.Options = append(fuseMountOptions.Options, "async_dio")}- if *option.cacheSymlink {+ if option.cacheSymlink != nil && *option.cacheSymlink {fuseMountOptions.EnableSymlinkCaching = true}