mirror of
https://github.com/minio/minio.git
synced 2025-11-22 10:37:42 -05:00
Expose total and available disk space (#7453)
This commit is contained in:
committed by
Nitish Tiwari
parent
979309148e
commit
0188009c7e
11
cmd/xl-v1.go
11
cmd/xl-v1.go
@@ -120,18 +120,23 @@ func getStorageInfo(disks []StorageAPI) StorageInfo {
|
||||
return StorageInfo{}
|
||||
}
|
||||
|
||||
// Combine all disks to get total usage.
|
||||
var used uint64
|
||||
// Combine all disks to get total usage
|
||||
var used, total, available uint64
|
||||
for _, di := range validDisksInfo {
|
||||
used = used + di.Used
|
||||
total = total + di.Total
|
||||
available = available + di.Free
|
||||
}
|
||||
|
||||
_, sscParity := getRedundancyCount(standardStorageClass, len(disks))
|
||||
_, rrscparity := getRedundancyCount(reducedRedundancyStorageClass, len(disks))
|
||||
|
||||
storageInfo := StorageInfo{
|
||||
Used: used,
|
||||
Used: used,
|
||||
Total: total,
|
||||
Available: available,
|
||||
}
|
||||
|
||||
storageInfo.Backend.Type = BackendErasure
|
||||
storageInfo.Backend.OnlineDisks = onlineDisks
|
||||
storageInfo.Backend.OfflineDisks = offlineDisks
|
||||
|
||||
Reference in New Issue
Block a user