use existing attributes instead of fetching from filer
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user