aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/entry.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filer/entry.go')
-rw-r--r--weed/filer/entry.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/filer/entry.go b/weed/filer/entry.go
index 4757d5c9e..25fc26feb 100644
--- a/weed/filer/entry.go
+++ b/weed/filer/entry.go
@@ -92,7 +92,12 @@ func (entry *Entry) ToExistingProtoEntry(message *filer_pb.Entry) {
return
}
message.IsDirectory = entry.IsDirectory()
- message.Attributes = EntryAttributeToPb(entry)
+ // Reuse pre-allocated attributes if available, otherwise allocate
+ if message.Attributes != nil {
+ EntryAttributeToExistingPb(entry, message.Attributes)
+ } else {
+ message.Attributes = EntryAttributeToPb(entry)
+ }
message.Chunks = entry.GetChunks()
message.Extended = entry.Extended
message.HardLinkId = entry.HardLinkId