aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-12-13 10:05:43 -0800
committerChris Lu <chris.lu@gmail.com>2019-12-13 10:05:43 -0800
commit05c3b795dcc159f0e6397af972d93a497ac555ae (patch)
tree849650a65ed8260d1fa933f9b54a783ebe768e8a /weed/filesys/wfs.go
parent987108a2b16e61595d0c7768ca47937d0652d5c4 (diff)
downloadseaweedfs-05c3b795dcc159f0e6397af972d93a497ac555ae.tar.xz
seaweedfs-05c3b795dcc159f0e6397af972d93a497ac555ae.zip
filer: configurable directory list cache size
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 1bd9b5cc9..9711a1e24 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -8,13 +8,14 @@ import (
"sync"
"time"
+ "github.com/karlseguin/ccache"
+ "google.golang.org/grpc"
+
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
- "github.com/karlseguin/ccache"
"github.com/seaweedfs/fuse"
"github.com/seaweedfs/fuse/fs"
- "google.golang.org/grpc"
)
type Option struct {
@@ -26,7 +27,7 @@ type Option struct {
TtlSec int32
ChunkSizeLimit int64
DataCenter string
- DirListingLimit int
+ DirListingLimit int64
EntryCacheTtl time.Duration
Umask os.FileMode
@@ -60,7 +61,7 @@ type statsCache struct {
func NewSeaweedFileSystem(option *Option) *WFS {
wfs := &WFS{
option: option,
- listDirectoryEntriesCache: ccache.New(ccache.Configure().MaxSize(1024 * 8).ItemsToPrune(100)),
+ listDirectoryEntriesCache: ccache.New(ccache.Configure().MaxSize(option.DirListingLimit * 3).ItemsToPrune(100)),
pathToHandleIndex: make(map[string]int),
bufPool: sync.Pool{
New: func() interface{} {