mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
listobjectversions: Add shortcut for Veeam blocks (#10893)
Add shortcut for `APN/1.0 Veeam/1.0 Backup/10.0` It requests unique blocks with a specific prefix. We skip scanning the parent directory for more objects matching the prefix.
This commit is contained in:
@@ -87,6 +87,9 @@ type listPathOptions struct {
|
||||
// This means the cache metadata will not be persisted on disk.
|
||||
// A transient result will never be returned from the cache so knowing the list id is required.
|
||||
Transient bool
|
||||
|
||||
// singleObject will assume that prefix refers to an exact single object.
|
||||
singleObject bool
|
||||
}
|
||||
|
||||
func init() {
|
||||
@@ -542,7 +545,7 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
|
||||
console.Printf("listPath with options: %#v\n", o)
|
||||
}
|
||||
// See if we have the listing stored.
|
||||
if !o.Create {
|
||||
if !o.Create && !o.singleObject {
|
||||
entries, err := er.streamMetadataParts(ctx, o)
|
||||
switch err {
|
||||
case nil, io.EOF, context.Canceled, context.DeadlineExceeded:
|
||||
@@ -662,6 +665,10 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
|
||||
|
||||
// Write results to disk.
|
||||
bw := newMetacacheBlockWriter(cacheCh, func(b *metacacheBlock) error {
|
||||
if o.singleObject {
|
||||
// Don't save single object listings.
|
||||
return nil
|
||||
}
|
||||
if debugPrint {
|
||||
console.Println("listPath: saving block", b.n, "to", o.objectPath(b.n))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user