fuse: add FUSE performance options to weed fuse command (#7925)

This adds support for the new FUSE performance options to the 'weed fuse' command,
matching the functionality available in 'weed mount'.

Added options:
- writebackCache: Enable FUSE writeback cache for improved write performance
- asyncDio: Enable async direct I/O for better concurrency
- cacheSymlink: Enable symlink caching to reduce metadata lookups
- sys.novncache: (macOS only) Disable vnode name caching to avoid stale data

These options can now be used with mount -t weed:
  mount -t weed fuse /mnt -o "filer=localhost:8888,writebackCache=true,asyncDio=true"

This ensures feature parity between 'weed mount' and 'weed fuse' commands.
This commit is contained in:
Chris Lu
2025-12-31 01:04:16 -08:00
committed by GitHub
parent 099da9332b
commit 5a135f8c5a
2 changed files with 34 additions and 4 deletions

View File

@@ -224,6 +224,36 @@ func runFuse(cmd *Command, args []string) bool {
fusermountPath = parameter.value
case "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.name
if parameter.value != "true" {