xl: refactor functions to xl-v1-common.go xl-v1-utils.go. (#1357)

This commit is contained in:
Krishna Srinivas
2016-04-22 22:54:04 +05:30
committed by Harshavardhana
parent becc814531
commit 8c85815106
8 changed files with 230 additions and 185 deletions

View File

@@ -98,16 +98,15 @@ func (xl XL) getFileQuorumVersionMap(volume, path string) map[int]int64 {
continue
}
if version := metadata.Get("file.version"); version == nil {
version, err := metadata.GetFileVersion()
if err == errMetadataKeyNotExist {
fileQuorumVersionMap[index] = 0
} else {
// Convert string to integer.
fileVersion, err := strconv.ParseInt(version[0], 10, 64)
if err != nil {
continue
}
fileQuorumVersionMap[index] = fileVersion
continue
}
if err != nil {
continue
}
fileQuorumVersionMap[index] = version
}
return fileQuorumVersionMap
}