From 1e6d67b16d4ba1af5a117959c867a693214d9bcd Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 14 Sep 2016 13:43:08 -0700 Subject: [PATCH] server: Remove deadcode. (#2699) --- cmd/format-config-v1_test.go | 8 ++++---- cmd/fs-v1.go | 4 ++-- cmd/posix-errors.go | 11 ----------- cmd/xl-v1-errors.go | 3 --- cmd/xl-v1-healing.go | 11 ----------- 5 files changed, 6 insertions(+), 31 deletions(-) diff --git a/cmd/format-config-v1_test.go b/cmd/format-config-v1_test.go index a9c44cc37..515ea31fd 100644 --- a/cmd/format-config-v1_test.go +++ b/cmd/format-config-v1_test.go @@ -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) } } diff --git a/cmd/fs-v1.go b/cmd/fs-v1.go index b9ee3380e..c86a482d8 100644 --- a/cmd/fs-v1.go +++ b/cmd/fs-v1.go @@ -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. diff --git a/cmd/posix-errors.go b/cmd/posix-errors.go index 0fc152822..bbdc60495 100644 --- a/cmd/posix-errors.go +++ b/cmd/posix-errors.go @@ -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 { diff --git a/cmd/xl-v1-errors.go b/cmd/xl-v1-errors.go index 582f80f82..faa03e92f 100644 --- a/cmd/xl-v1-errors.go +++ b/cmd/xl-v1-errors.go @@ -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") diff --git a/cmd/xl-v1-healing.go b/cmd/xl-v1-healing.go index 73b0768c1..5fc320652 100644 --- a/cmd/xl-v1-healing.go +++ b/cmd/xl-v1-healing.go @@ -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))