Browse Source

use existing attributes instead of fetching from filer

pull/664/head
Chris Lu 7 years ago
parent
commit
6d1bcd4b8c
  1. 3
      weed/filesys/file.go

3
weed/filesys/file.go

@ -28,6 +28,8 @@ type File struct {
func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
fullPath := filepath.Join(file.dir.Path, file.Name)
if file.attributes == nil {
item := file.wfs.listDirectoryEntriesCache.Get(fullPath)
if item != nil {
entry := item.Value().(*filer_pb.Entry)
@ -60,6 +62,7 @@ func (file *File) Attr(context context.Context, attr *fuse.Attr) error {
return err
}
}
}
attr.Mode = os.FileMode(file.attributes.FileMode)
attr.Size = filer2.TotalSize(file.Chunks)

Loading…
Cancel
Save