mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
erasure: allocate buffer only for non-nil disk (#1811)
This commit is contained in:
parent
89f65333fb
commit
db2fdbf38d
@ -34,12 +34,11 @@ func (e erasure) ReadFile(volume, path string, startOffset int64, buffer []byte)
|
||||
// Read from all the disks.
|
||||
for index, disk := range e.storageDisks {
|
||||
blockIndex := e.distribution[index] - 1
|
||||
// Initialize shard slice and fill the data from each parts.
|
||||
enBlocks[blockIndex] = make([]byte, curEncBlockSize)
|
||||
if disk == nil {
|
||||
enBlocks[blockIndex] = nil
|
||||
continue
|
||||
}
|
||||
// Initialize shard slice and fill the data from each parts.
|
||||
enBlocks[blockIndex] = make([]byte, curEncBlockSize)
|
||||
// Read the necessary blocks.
|
||||
_, err := disk.ReadFile(volume, path, offsetEncOffset, enBlocks[blockIndex])
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user