1
0
mirror of https://github.com/rclone/rclone.git synced 2025-11-23 21:44:49 +02:00

swift: Report disk usage in segment containers

Large objects are split and stored in a _segments container in Swift.
These should be included when reporting on the space used.

Fixes #8857
This commit is contained in:
Andrew Ruthven
2025-10-30 05:55:53 +13:00
committed by GitHub
parent 87b71dd6b9
commit 5420dbbe38
2 changed files with 52 additions and 2 deletions

View File

@@ -943,6 +943,20 @@ func (f *Fs) About(ctx context.Context) (usage *fs.Usage, err error) {
used = container.Bytes
objects = container.Count
total = container.QuotaBytes
if f.opt.UseSegmentsContainer.Value {
err = f.pacer.Call(func() (bool, error) {
segmentsContainer := f.rootContainer + segmentsContainerSuffix
container, _, err = f.c.Container(ctx, segmentsContainer)
return shouldRetry(ctx, err)
})
if err != nil && err != swift.ContainerNotFound {
return nil, fmt.Errorf("container info failed: %w", err)
}
if err == nil {
used += container.Bytes
}
}
} else {
var containers []swift.Container
err = f.pacer.Call(func() (bool, error) {