mirror of
https://github.com/minio/minio.git
synced 2025-11-09 13:39:46 -05:00
fs: use new atomic package - use FileCreateWithPrefix() API
This commit is contained in:
@@ -276,7 +276,7 @@ func (fs Filesystem) CreateObjectPart(bucket, object, uploadID, expectedMD5Sum s
|
||||
|
||||
objectPath := filepath.Join(bucketPath, object)
|
||||
partPath := objectPath + fmt.Sprintf("$%d", partID)
|
||||
partFile, err := atomic.FileCreate(partPath)
|
||||
partFile, err := atomic.FileCreateWithPrefix(partPath, "")
|
||||
if err != nil {
|
||||
return "", probe.NewError(err)
|
||||
}
|
||||
@@ -307,7 +307,6 @@ func (fs Filesystem) CreateObjectPart(bucket, object, uploadID, expectedMD5Sum s
|
||||
return "", probe.NewError(SignatureDoesNotMatch{})
|
||||
}
|
||||
}
|
||||
partFile.File.Sync()
|
||||
partFile.Close()
|
||||
|
||||
fi, err := os.Stat(partPath)
|
||||
@@ -374,7 +373,7 @@ func (fs Filesystem) CompleteMultipartUpload(bucket, object, uploadID string, da
|
||||
}
|
||||
|
||||
objectPath := filepath.Join(bucketPath, object)
|
||||
file, err := atomic.FileCreate(objectPath)
|
||||
file, err := atomic.FileCreateWithPrefix(objectPath, "")
|
||||
if err != nil {
|
||||
return ObjectMetadata{}, probe.NewError(err)
|
||||
}
|
||||
@@ -430,7 +429,6 @@ func (fs Filesystem) CompleteMultipartUpload(bucket, object, uploadID string, da
|
||||
file.CloseAndPurge()
|
||||
return ObjectMetadata{}, err.Trace()
|
||||
}
|
||||
file.File.Sync()
|
||||
file.Close()
|
||||
|
||||
st, err := os.Stat(objectPath)
|
||||
|
||||
@@ -207,7 +207,7 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
|
||||
}
|
||||
|
||||
// write object
|
||||
file, err := atomic.FileCreate(objectPath)
|
||||
file, err := atomic.FileCreateWithPrefix(objectPath, "")
|
||||
if err != nil {
|
||||
return ObjectMetadata{}, probe.NewError(err)
|
||||
}
|
||||
@@ -250,7 +250,6 @@ func (fs Filesystem) CreateObject(bucket, object, expectedMD5Sum string, size in
|
||||
return ObjectMetadata{}, probe.NewError(SignatureDoesNotMatch{})
|
||||
}
|
||||
}
|
||||
file.File.Sync()
|
||||
file.Close()
|
||||
|
||||
st, err := os.Stat(objectPath)
|
||||
|
||||
Reference in New Issue
Block a user