aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-03-09 22:26:51 -0800
committerchrislu <chris.lu@gmail.com>2022-03-09 22:26:51 -0800
commit011a41b561ed3c8c496aead94f17c8f55d25429d (patch)
tree305a21de9bec7bae370cf0ecca8a56efe20f37e7 /weed/mount/weedfs.go
parentfc0a583a4d2ffdc0d44ac640620bb4e09b31f9f5 (diff)
downloadseaweedfs-011a41b561ed3c8c496aead94f17c8f55d25429d.tar.xz
seaweedfs-011a41b561ed3c8c496aead94f17c8f55d25429d.zip
add back writes to swap file when too many in memory chunks are used.
Diffstat (limited to 'weed/mount/weedfs.go')
-rw-r--r--weed/mount/weedfs.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go
index 52eefab32..260a4e1da 100644
--- a/weed/mount/weedfs.go
+++ b/weed/mount/weedfs.go
@@ -16,6 +16,7 @@ import (
"math/rand"
"os"
"path"
+ "path/filepath"
"time"
"github.com/hanwen/go-fuse/v2/fs"
@@ -50,7 +51,8 @@ type Option struct {
Cipher bool // whether encrypt data on volume server
UidGidMapper *meta_cache.UidGidMapper
- uniqueCacheDir string
+ uniqueCacheDir string
+ uniqueCacheTempPageDir string
}
type WFS struct {
@@ -177,7 +179,12 @@ func (wfs *WFS) getCurrentFiler() pb.ServerAddress {
func (option *Option) setupUniqueCacheDirectory() {
cacheUniqueId := util.Md5String([]byte(option.MountDirectory + string(option.FilerAddresses[0]) + option.FilerMountRootPath + util.Version()))[0:8]
option.uniqueCacheDir = path.Join(option.CacheDir, cacheUniqueId)
- os.MkdirAll(option.uniqueCacheDir, os.FileMode(0777)&^option.Umask)
+ option.uniqueCacheTempPageDir = filepath.Join(option.uniqueCacheDir, "swap")
+ os.MkdirAll(option.uniqueCacheTempPageDir, os.FileMode(0777)&^option.Umask)
+}
+
+func (option *Option) getTempFilePageDir() string {
+ return option.uniqueCacheTempPageDir
}
func (option *Option) getUniqueCacheDir() string {