mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
parent
658a595d7a
commit
ca097de96c
@ -52,8 +52,9 @@ func newFSObjects(exportPath string) (ObjectLayer, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// Cleanup all temp entries upon start.
|
||||
cleanupAllTmpEntries(storage)
|
||||
// Initialize object layer - like creating minioMetaBucket,
|
||||
// cleaning up tmp files etc.
|
||||
initObjectLayer(storage)
|
||||
|
||||
// Return successfully initialized object layer.
|
||||
return fsObjects{
|
||||
|
@ -24,6 +24,24 @@ import (
|
||||
"sort"
|
||||
)
|
||||
|
||||
// Common initialization needed for both object layers.
|
||||
func initObjectLayer(storage StorageAPI) error {
|
||||
// This happens for the first time, but keep this here since this
|
||||
// is the only place where it can be made expensive optimizing all
|
||||
// other calls. Create minio meta volume, if it doesn't exist yet.
|
||||
if err := storage.MakeVol(minioMetaBucket); err != nil {
|
||||
if err != errVolumeExists {
|
||||
return toObjectErr(err, minioMetaBucket)
|
||||
}
|
||||
}
|
||||
// Cleanup all temp entries upon start.
|
||||
err := cleanupAllTmpEntries(storage)
|
||||
if err != nil {
|
||||
return toObjectErr(err, minioMetaBucket, tmpMetaPrefix)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
/// Common object layer functions.
|
||||
|
||||
// makeBucket - create a bucket, is a common function for both object layers.
|
||||
@ -35,15 +53,6 @@ func makeBucket(storage StorageAPI, bucket string) error {
|
||||
if err := storage.MakeVol(bucket); err != nil {
|
||||
return toObjectErr(err, bucket)
|
||||
}
|
||||
// This happens for the first time, but keep this here since this
|
||||
// is the only place where it can be made expensive optimizing all
|
||||
// other calls.
|
||||
// Create minio meta volume, if it doesn't exist yet.
|
||||
if err := storage.MakeVol(minioMetaBucket); err != nil {
|
||||
if err != errVolumeExists {
|
||||
return toObjectErr(err, minioMetaBucket)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -53,8 +53,9 @@ func newXLObjects(exportPaths ...string) (ObjectLayer, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Cleanup all temporary entries.
|
||||
cleanupAllTmpEntries(storage)
|
||||
// Initialize object layer - like creating minioMetaBucket,
|
||||
// cleaning up tmp files etc.
|
||||
initObjectLayer(storage)
|
||||
|
||||
// Return successfully initialized object layer.
|
||||
return xlObjects{
|
||||
|
Loading…
Reference in New Issue
Block a user