server: Remove deadcode. (#2699)

This commit is contained in:
Harshavardhana 2016-09-14 13:43:08 -07:00 committed by GitHub
parent 6533927237
commit 1e6d67b16d
5 changed files with 6 additions and 31 deletions

View File

@ -629,19 +629,19 @@ func TestReduceFormatErrs(t *testing.T) {
}
// One corrupted format
if err := reduceFormatErrs([]error{nil, nil, errCorruptedFormat, nil}, 4); err != errCorruptedFormat {
t.Fatal("Got a differnt error: ", err)
t.Fatal("Got a different error: ", err)
}
// All disks unformatted
if err := reduceFormatErrs([]error{errUnformattedDisk, errUnformattedDisk, errUnformattedDisk, errUnformattedDisk}, 4); err != errUnformattedDisk {
t.Fatal("Got a differnt error: ", err)
t.Fatal("Got a different error: ", err)
}
// Some disks unformatted
if err := reduceFormatErrs([]error{nil, nil, errUnformattedDisk, errUnformattedDisk}, 4); err != errSomeDiskUnformatted {
t.Fatal("Got a differnt error: ", err)
t.Fatal("Got a different error: ", err)
}
// Some disks offline
if err := reduceFormatErrs([]error{nil, nil, errDiskNotFound, errUnformattedDisk}, 4); err != errSomeDiskOffline {
t.Fatal("Got a differnt error: ", err)
t.Fatal("Got a different error: ", err)
}
}

View File

@ -117,14 +117,14 @@ func (fs fsObjects) Shutdown() error {
_, err := fs.storage.ListDir(minioMetaBucket, mpartMetaPrefix)
if err != errFileNotFound {
// A nil err means that multipart directory is not empty hence do not remove '.minio.sys' volume.
// A non nil err means that an unexpected error occured
// A non nil err means that an unexpected error occurred
return err
}
// List if there are any bucket configuration entries.
_, err = fs.storage.ListDir(minioMetaBucket, bucketConfigPrefix)
if err != errFileNotFound {
// A nil err means that bucket config directory is not empty hence do not remove '.minio.sys' volume.
// A non nil err means that an unexpected error occured
// A non nil err means that an unexpected error occurred
return err
}
// Cleanup everything else.

View File

@ -33,17 +33,6 @@ func isSysErrNotDir(err error) bool {
return false
}
// Check if the given error corresponds to EISDIR (is a directory)
func isSysErrIsDir(err error) bool {
if pathErr, ok := err.(*os.PathError); ok {
switch pathErr.Err {
case syscall.EISDIR:
return true
}
}
return false
}
// Check if the given error corresponds to ENOTEMPTY for unix
// and ERROR_DIR_NOT_EMPTY for windows (directory not empty)
func isSysErrNotEmpty(err error) bool {

View File

@ -27,9 +27,6 @@ var errXLMinDisks = errors.New("Minimum '4' disks are required to enable erasure
// errXLNumDisks - returned for odd number of disks.
var errXLNumDisks = errors.New("Total number of disks should be multiples of '2'")
// errXLDuplicateArguments - returned for duplicate disks.
var errXLDuplicateArguments = errors.New("Duplicate disks found.")
// errXLReadQuorum - did not meet read quorum.
var errXLReadQuorum = errors.New("Read failed. Insufficient number of disks online")

View File

@ -119,17 +119,6 @@ func outDatedDisks(disks []StorageAPI, partsMetadata []xlMetaV1, errs []error) (
return outDatedDisks
}
// Return xlMetaV1 of the latest version of the object.
func xlLatestMetadata(partsMetadata []xlMetaV1, errs []error) (latestMeta xlMetaV1) {
// List all the file commit ids from parts metadata.
modTimes := listObjectModtimes(partsMetadata, errs)
// Reduce list of UUIDs to a single common value.
modTime := commonTime(modTimes)
return pickValidXLMeta(partsMetadata, modTime)
}
// Returns if the object should be healed.
func xlShouldHeal(partsMetadata []xlMetaV1, errs []error) bool {
modTime := commonTime(listObjectModtimes(partsMetadata, errs))