Fix free drive space calculation in XL mode (#2917)

This commit is contained in:
Anis Elleuch
2016-10-13 04:22:15 +01:00
committed by Harshavardhana
parent 92858c7db2
commit 84acc820c7
2 changed files with 23 additions and 10 deletions

View File

@@ -124,7 +124,13 @@ func printObjectAPIMsg() {
// Get formatted disk/storage info message.
func getStorageInfoMsg(storageInfo StorageInfo) string {
msg := fmt.Sprintf("%s %s Free", colorBlue("Drive Capacity:"), humanize.IBytes(uint64(storageInfo.Free)))
freeSpace := uint64(storageInfo.Free)
totalSpace := uint64(storageInfo.Total)
if storageInfo.Backend.Type == XL {
freeSpace /= 2
totalSpace /= 2
}
msg := fmt.Sprintf("%s %s Free, %s Total", colorBlue("Drive Capacity:"), humanize.IBytes(freeSpace), humanize.IBytes(totalSpace))
diskInfo := fmt.Sprintf(" %d Online, %d Offline. We can withstand [%d] more drive failure(s).",
storageInfo.Backend.OnlineDisks,
storageInfo.Backend.OfflineDisks,