diff options
Diffstat (limited to 'src/MultiFileAllocationIterator.cc')
| -rw-r--r-- | src/MultiFileAllocationIterator.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/MultiFileAllocationIterator.cc b/src/MultiFileAllocationIterator.cc index 680a7bc0..349d174f 100644 --- a/src/MultiFileAllocationIterator.cc +++ b/src/MultiFileAllocationIterator.cc @@ -59,8 +59,12 @@ void MultiFileAllocationIterator::allocateChunk() DiskWriterEntryHandle entry = _entries.front(); _entries.pop_front(); FileEntryHandle fileEntry = entry->getFileEntry(); + // Open file before calling DiskWriterEntry::size() + _diskAdaptor->openIfNot(entry, &DiskWriterEntry::openFile, + _diskAdaptor->getTopDirPath()); + entry->enableDirectIO(); if(entry->size() < fileEntry->getLength()) { - entry->getDiskWriter()->enableDirectIO(); + // Calling private function of MultiDiskAdaptor. _fileAllocationIterator.reset (new SingleFileAllocationIterator(entry->getDiskWriter().get(), entry->size(), |
