|
@ -139,8 +139,7 @@ func (file *File) maybeLoadAttributes(ctx context.Context) error { |
|
|
item := file.wfs.listDirectoryEntriesCache.Get(file.fullpath()) |
|
|
item := file.wfs.listDirectoryEntriesCache.Get(file.fullpath()) |
|
|
if item != nil && !item.Expired() { |
|
|
if item != nil && !item.Expired() { |
|
|
entry := item.Value().(*filer_pb.Entry) |
|
|
entry := item.Value().(*filer_pb.Entry) |
|
|
file.entry = entry |
|
|
|
|
|
file.entryViewCache = nil |
|
|
|
|
|
|
|
|
file.setEntry(entry) |
|
|
// glog.V(1).Infof("file attr read cached %v attributes", file.Name)
|
|
|
// glog.V(1).Infof("file attr read cached %v attributes", file.Name)
|
|
|
} else { |
|
|
} else { |
|
|
err := file.wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error { |
|
|
err := file.wfs.withFilerClient(func(client filer_pb.SeaweedFilerClient) error { |
|
@ -156,8 +155,7 @@ func (file *File) maybeLoadAttributes(ctx context.Context) error { |
|
|
return fuse.ENOENT |
|
|
return fuse.ENOENT |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
file.entry = resp.Entry |
|
|
|
|
|
file.entryViewCache = nil |
|
|
|
|
|
|
|
|
file.setEntry(resp.Entry) |
|
|
|
|
|
|
|
|
glog.V(3).Infof("file attr %v %+v: %d", file.fullpath(), file.entry.Attributes, filer2.TotalSize(file.entry.Chunks)) |
|
|
glog.V(3).Infof("file attr %v %+v: %d", file.fullpath(), file.entry.Attributes, filer2.TotalSize(file.entry.Chunks)) |
|
|
|
|
|
|
|
@ -188,3 +186,8 @@ func (file *File) addChunks(chunks []*filer_pb.FileChunk) { |
|
|
} |
|
|
} |
|
|
file.entryViewCache = filer2.NonOverlappingVisibleIntervals(file.entry.Chunks) |
|
|
file.entryViewCache = filer2.NonOverlappingVisibleIntervals(file.entry.Chunks) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func (file *File) setEntry(entry *filer_pb.Entry) { |
|
|
|
|
|
file.entry = entry |
|
|
|
|
|
file.entryViewCache = filer2.NonOverlappingVisibleIntervals(file.entry.Chunks) |
|
|
|
|
|
} |