XL: isQuorum rename as isDiskQuorum, word it properly. (#2196)

This commit is contained in:
Harshavardhana
2016-07-13 00:29:48 -07:00
committed by Anand Babu (AB) Periasamy
parent 3b69b4ada4
commit dc3bafb194
7 changed files with 28 additions and 25 deletions
+8 -6
View File
@@ -76,16 +76,18 @@ func reduceErrs(errs []error) error {
return errTypes[max].err
}
// Validates if we have quorum based on the errors with errDiskNotFound.
func isQuorum(errs []error, minQuorumCount int) bool {
var errCount int
// Validates if we have quorum based on the errors related to disk only.
// Returns 'true' if we have quorum, 'false' if we don't.
func isDiskQuorum(errs []error, minQuorumCount int) bool {
var count int
for _, err := range errs {
if err == errDiskNotFound || err == errFaultyDisk || err == errDiskAccessDenied {
switch err {
case errDiskNotFound, errFaultyDisk, errDiskAccessDenied:
continue
}
errCount++
count++
}
return errCount >= minQuorumCount
return count >= minQuorumCount
}
// Similar to 'len(slice)' but returns the actual elements count