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
mount: add -asyncDio flag for async direct I/O (#7922)
Chris Lu9072e1d38ac7
diff --git a/weed/command/mount.go b/weed/command/mount.goindex 82b74f7917..ddd429ccc4 100644--- a/weed/command/mount.go+++ b/weed/command/mount.go@@ -50,6 +50,11 @@ type MountOptions struct {// FUSE performance optionswritebackCache *bool+ asyncDio *bool+ cacheSymlink *bool++ // macOS-specific FUSE options+ novncache *bool}var (@@ -108,6 +113,11 @@ func init() {// FUSE performance optionsmountOptions.writebackCache = cmdMount.Flag.Bool("writebackCache", false, "enable FUSE writeback cache for improved write performance (at risk of data loss on crash)")+ mountOptions.asyncDio = cmdMount.Flag.Bool("asyncDio", false, "enable async direct I/O for better concurrency")+ mountOptions.cacheSymlink = cmdMount.Flag.Bool("cacheSymlink", false, "enable symlink caching to reduce metadata lookups")++ // macOS-specific FUSE options+ mountOptions.novncache = cmdMount.Flag.Bool("sys.novncache", false, "(macOS only) disable vnode name caching to avoid stale data")}var cmdMount = &Command{diff --git a/weed/command/mount_std.go b/weed/command/mount_std.goindex 7e688fc275..497a1eec82 100644--- a/weed/command/mount_std.go+++ b/weed/command/mount_std.go@@ -208,7 +208,9 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {if runtime.GOARCH == "amd64" {fuseMountOptions.Options = append(fuseMountOptions.Options, "noapplexattr")}- // fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache") // need to test effectiveness+ if *option.novncache {+ fuseMountOptions.Options = append(fuseMountOptions.Options, "novncache")+ }fuseMountOptions.Options = append(fuseMountOptions.Options, "slow_statfs")fuseMountOptions.Options = append(fuseMountOptions.Options, "volname="+serverFriendlyName)fuseMountOptions.Options = append(fuseMountOptions.Options, fmt.Sprintf("iosize=%d", ioSizeMB*1024*1024))@@ -217,6 +219,12 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {if *option.writebackCache {fuseMountOptions.Options = append(fuseMountOptions.Options, "writeback_cache")}+ if *option.asyncDio {+ fuseMountOptions.Options = append(fuseMountOptions.Options, "async_dio")+ }+ if *option.cacheSymlink {+ fuseMountOptions.EnableSymlinkCaching = true+ }// find mount pointmountRoot := filerMountRootPath