mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
reduce weed mount memory usage
This commit is contained in:
parent
2929563294
commit
60421b23f0
|
@ -31,8 +31,10 @@ var _ = fs.NodeSetattrer(&Dir{})
|
||||||
|
|
||||||
func (dir *Dir) Attr(context context.Context, attr *fuse.Attr) error {
|
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 == "/" {
|
if dir.Path == "/" {
|
||||||
attr.Valid = time.Second
|
|
||||||
attr.Mode = os.ModeDir | 0777
|
attr.Mode = os.ModeDir | 0777
|
||||||
return nil
|
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))
|
// glog.V(1).Infof("dir %s permission: %v", dir.Path, os.FileMode(attributes.FileMode))
|
||||||
|
|
||||||
attr.Mode = os.FileMode(dir.attributes.FileMode) | os.ModeDir
|
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.Mtime = time.Unix(dir.attributes.Mtime, 0)
|
||||||
attr.Ctime = time.Unix(dir.attributes.Crtime, 0)
|
attr.Ctime = time.Unix(dir.attributes.Crtime, 0)
|
||||||
|
|
Loading…
Reference in a new issue