aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/wfs.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-03-28 13:43:31 -0700
committerChris Lu <chris.lu@gmail.com>2020-03-28 13:43:31 -0700
commit826bc0b7e3b5eb0717c179987a32e3290e773527 (patch)
tree299a1b1d2333dd61127581863b96956fce7b4634 /weed/filesys/wfs.go
parent4aa82c95e6130b3eaa785f079a97552f354cefc4 (diff)
downloadseaweedfs-826bc0b7e3b5eb0717c179987a32e3290e773527.tar.xz
seaweedfs-826bc0b7e3b5eb0717c179987a32e3290e773527.zip
FUSE: add chunk cache for recently accessed file chunks
Diffstat (limited to 'weed/filesys/wfs.go')
-rw-r--r--weed/filesys/wfs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filesys/wfs.go b/weed/filesys/wfs.go
index 5075687e3..059a0ecc1 100644
--- a/weed/filesys/wfs.go
+++ b/weed/filesys/wfs.go
@@ -15,6 +15,7 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
+ "github.com/chrislusf/seaweedfs/weed/pb/pb_cache"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/seaweedfs/fuse"
"github.com/seaweedfs/fuse/fs"
@@ -62,6 +63,8 @@ type WFS struct {
root fs.Node
fsNodeCache *FsCache
+
+ chunkCache *pb_cache.ChunkCache
}
type statsCache struct {
filer_pb.StatisticsResponse
@@ -78,6 +81,7 @@ func NewSeaweedFileSystem(option *Option) *WFS {
return make([]byte, option.ChunkSizeLimit)
},
},
+ chunkCache: pb_cache.NewChunkCache(),
}
wfs.root = &Dir{name: wfs.option.FilerMountRootPath, wfs: wfs}