Add support of fallocate for FS and XL backends (#3032)

This commit is contained in:
Anis Elleuch
2016-10-29 20:44:44 +01:00
committed by Harshavardhana
parent 0b3282ac9f
commit a47ce7ab22
17 changed files with 415 additions and 50 deletions

View File

@@ -388,6 +388,15 @@ func (fs fsObjects) PutObject(bucket string, object string, size int64, data io.
return ObjectInfo{}, toObjectErr(traceError(err), bucket, object)
}
} else {
// Prepare file to avoid disk fragmentation
if size > 0 {
err = fs.storage.PrepareFile(minioMetaBucket, tempObj, size)
if err != nil {
return ObjectInfo{}, toObjectErr(err, bucket, object)
}
}
// Allocate a buffer to Read() from request body
bufSize := int64(readSizeV1)
if size > 0 && bufSize > size {