Add listing block reuse (#15579)

When streaming results, pool metadata slices when sent.
This commit is contained in:
Klaus Post 2022-08-24 18:11:16 +02:00 committed by GitHub
parent afbb63a197
commit 037fe4afdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -184,6 +184,9 @@ func (w *metacacheWriter) stream() (chan<- metaCacheEntry, error) {
continue
}
err = w.mw.WriteBytes(o.metadata)
if w.reuseBlocks || o.reusable {
metaDataPoolPut(o.metadata)
}
if err != nil {
w.streamErr = err
continue

View File

@ -168,7 +168,7 @@ func (s *xlStorage) WalkDir(ctx context.Context, opts WalkDirOptions, wr io.Writ
entries[i] = entries[i][:len(entry)-1]
continue
}
// Do do not retain the file.
// Do not retain the file.
entries[i] = ""
if contextCanceled(ctx) {