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: rename to dirListCacheLimit to configure cache for long format directory list
Chris Luf59119cd1d29
diff --git a/weed/command/mount.go b/weed/command/mount.goindex a7f836a4c2..f09b285f75 100644--- a/weed/command/mount.go+++ b/weed/command/mount.go@@ -10,7 +10,7 @@ type MountOptions struct {filer *stringfilerMountRootPath *stringdir *string- dirListingLimit *int64+ dirListCacheLimit *int64collection *stringreplication *stringttlSec *int@@ -31,7 +31,7 @@ func init() {mountOptions.filer = cmdMount.Flag.String("filer", "localhost:8888", "weed filer location")mountOptions.filerMountRootPath = cmdMount.Flag.String("filer.path", "/", "mount this remote path from filer server")mountOptions.dir = cmdMount.Flag.String("dir", ".", "mount weed filer to this directory")- mountOptions.dirListingLimit = cmdMount.Flag.Int64("dirListLimit", 1000000, "limit directory listing size")+ mountOptions.dirListCacheLimit = cmdMount.Flag.Int64("dirListCacheLimit", 1000000, "limit cache size to speed up directory long format listing")mountOptions.collection = cmdMount.Flag.String("collection", "", "collection to create the files")mountOptions.replication = cmdMount.Flag.String("replication", "", "replication(e.g. 000, 001) to create to files. If empty, let filer decide.")mountOptions.ttlSec = cmdMount.Flag.Int("ttl", 0, "file ttl in seconds")diff --git a/weed/command/mount_std.go b/weed/command/mount_std.goindex 6f91663308..453531d00f 100644--- a/weed/command/mount_std.go+++ b/weed/command/mount_std.go@@ -43,13 +43,13 @@ func runMount(cmd *Command, args []string) bool {*mountOptions.chunkSizeLimitMB,*mountOptions.allowOthers,*mountOptions.ttlSec,- *mountOptions.dirListingLimit,+ *mountOptions.dirListCacheLimit,os.FileMode(umask),)}func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCenter string, chunkSizeLimitMB int,- allowOthers bool, ttlSec int, dirListingLimit int64, umask os.FileMode) bool {+ allowOthers bool, ttlSec int, dirListCacheLimit int64, umask os.FileMode) bool {util.LoadConfiguration("security", false)@@ -155,7 +155,7 @@ func RunMount(filer, filerMountRootPath, dir, collection, replication, dataCenteTtlSec: int32(ttlSec),ChunkSizeLimit: int64(chunkSizeLimitMB) * 1024 * 1024,DataCenter: dataCenter,- DirListingLimit: dirListingLimit,+ DirListCacheLimit: dirListCacheLimit,EntryCacheTtl: 3 * time.Second,MountUid: uid,MountGid: gid,diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.goindex 9711a1e249..e924783ec4 100644--- a/weed/filesys/wfs.go+++ b/weed/filesys/wfs.go@@ -27,7 +27,7 @@ type Option struct {TtlSec int32ChunkSizeLimit int64DataCenter string- DirListingLimit int64+ DirListCacheLimit int64EntryCacheTtl time.DurationUmask os.FileMode@@ -61,7 +61,7 @@ type statsCache struct {func NewSeaweedFileSystem(option *Option) *WFS {wfs := &WFS{option: option,- listDirectoryEntriesCache: ccache.New(ccache.Configure().MaxSize(option.DirListingLimit * 3).ItemsToPrune(100)),+ listDirectoryEntriesCache: ccache.New(ccache.Configure().MaxSize(option.DirListCacheLimit * 3).ItemsToPrune(100)),pathToHandleIndex: make(map[string]int),bufPool: sync.Pool{New: func() interface{} {