mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
use existing attributes instead of fetching from filer
This commit is contained in:
parent
0a223838bd
commit
6d1bcd4b8c
|
@ -28,6 +28,8 @@ type File struct {
|
||||||
func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
|
func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
|
||||||
|
|
||||||
fullPath := filepath.Join(file.dir.Path, file.Name)
|
fullPath := filepath.Join(file.dir.Path, file.Name)
|
||||||
|
|
||||||
|
if file.attributes == nil {
|
||||||
item := file.wfs.listDirectoryEntriesCache.Get(fullPath)
|
item := file.wfs.listDirectoryEntriesCache.Get(fullPath)
|
||||||
if item != nil {
|
if item != nil {
|
||||||
entry := item.Value().(*filer_pb.Entry)
|
entry := item.Value().(*filer_pb.Entry)
|
||||||
|
@ -60,6 +62,7 @@ func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
attr.Mode = os.FileMode(file.attributes.FileMode)
|
attr.Mode = os.FileMode(file.attributes.FileMode)
|
||||||
attr.Size = filer2.TotalSize(file.Chunks)
|
attr.Size = filer2.TotalSize(file.Chunks)
|
||||||
|
|
Loading…
Reference in a new issue