|
|
@ -175,20 +175,21 @@ func getStorageInfo(disks []StorageAPI, endpoints Endpoints) StorageInfo { |
|
|
|
|
|
|
|
|
|
|
|
// StorageInfo - returns underlying storage statistics.
|
|
|
|
// StorageInfo - returns underlying storage statistics.
|
|
|
|
func (xl xlObjects) StorageInfo(ctx context.Context, local bool) StorageInfo { |
|
|
|
func (xl xlObjects) StorageInfo(ctx context.Context, local bool) StorageInfo { |
|
|
|
var endpoints = xl.endpoints |
|
|
|
|
|
|
|
var disks []StorageAPI |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if !local { |
|
|
|
disks := xl.getDisks() |
|
|
|
disks = xl.getDisks() |
|
|
|
if local { |
|
|
|
} else { |
|
|
|
var localDisks []StorageAPI |
|
|
|
for i, d := range xl.getDisks() { |
|
|
|
for i, disk := range disks { |
|
|
|
if endpoints[i].IsLocal && d.Hostname() == "" { |
|
|
|
if disk != nil { |
|
|
|
// Append this local disk since local flag is true
|
|
|
|
if xl.endpoints[i].IsLocal && disk.Hostname() == "" { |
|
|
|
disks = append(disks, d) |
|
|
|
// Append this local disk since local flag is true
|
|
|
|
|
|
|
|
localDisks = append(localDisks, disk) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
disks = localDisks |
|
|
|
} |
|
|
|
} |
|
|
|
return getStorageInfo(disks, endpoints) |
|
|
|
return getStorageInfo(disks, xl.endpoints) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// GetMetrics - is not implemented and shouldn't be called.
|
|
|
|
// GetMetrics - is not implemented and shouldn't be called.
|
|
|
|