diff options
| author | Chris Lu <chris.lu@gmail.com> | 2018-11-18 07:49:14 -0800 |
|---|---|---|
| committer | Chris Lu <chris.lu@gmail.com> | 2018-11-18 07:49:14 -0800 |
| commit | 60421b23f0b348ee4a87a72608bd58270c861eaa (patch) | |
| tree | 0dd2ec0875a31b5a21cd2b7d9b18a2d6b64571d6 | |
| parent | 29295632945228934cad72de6c82e0a075e24fcb (diff) | |
| download | seaweedfs-60421b23f0b348ee4a87a72608bd58270c861eaa.tar.xz seaweedfs-60421b23f0b348ee4a87a72608bd58270c861eaa.zip | |
reduce weed mount memory usage
| -rw-r--r-- | weed/filesys/dir.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/weed/filesys/dir.go b/weed/filesys/dir.go index caeada482..44f4f48cc 100644 --- a/weed/filesys/dir.go +++ b/weed/filesys/dir.go @@ -31,8 +31,10 @@ var _ = fs.NodeSetattrer(&Dir{}) func (dir *Dir) Attr(context context.Context, attr *fuse.Attr) error { + // https://github.com/bazil/fuse/issues/196 + attr.Valid = time.Second + if dir.Path == "/" { - attr.Valid = time.Second attr.Mode = os.ModeDir | 0777 return nil } @@ -83,9 +85,6 @@ func (dir *Dir) Attr(context context.Context, attr *fuse.Attr) error { // glog.V(1).Infof("dir %s permission: %v", dir.Path, os.FileMode(attributes.FileMode)) attr.Mode = os.FileMode(dir.attributes.FileMode) | os.ModeDir - if dir.Path == "/" && dir.attributes.FileMode == 0 { - attr.Valid = time.Second - } attr.Mtime = time.Unix(dir.attributes.Mtime, 0) attr.Ctime = time.Unix(dir.attributes.Crtime, 0) |
