XL: Re-align the code again.

This commit is contained in:
Harshavardhana
2016-06-02 01:49:46 -07:00
parent ae311aa53b
commit de21126f7e
7 changed files with 126 additions and 132 deletions
+11
View File
@@ -17,6 +17,7 @@
package main
import (
"path/filepath"
"strings"
"sync"
)
@@ -43,6 +44,16 @@ func fsHouseKeeping(storageDisk StorageAPI) error {
return nil
}
// Depending on the disk type network or local, initialize storage API.
func newStorageAPI(disk string) (storage StorageAPI, err error) {
if !strings.ContainsRune(disk, ':') || filepath.VolumeName(disk) != "" {
// Initialize filesystem storage API.
return newPosix(disk)
}
// Initialize rpc client storage API.
return newRPCClient(disk)
}
// House keeping code needed for XL.
func xlHouseKeeping(storageDisks []StorageAPI) error {
// This happens for the first time, but keep this here since this