summaryrefslogtreecommitdiff
path: root/src/MultiFileAllocationIterator.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/MultiFileAllocationIterator.cc')
-rw-r--r--src/MultiFileAllocationIterator.cc18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/MultiFileAllocationIterator.cc b/src/MultiFileAllocationIterator.cc
index e45c71e6..f17115fe 100644
--- a/src/MultiFileAllocationIterator.cc
+++ b/src/MultiFileAllocationIterator.cc
@@ -67,20 +67,22 @@ void MultiFileAllocationIterator::allocateChunk()
diskAdaptor_->openIfNot(entry, &DiskWriterEntry::openFile);
if(entry->needsFileAllocation() && entry->size() < fileEntry->getLength()) {
// Calling private function of MultiDiskAdaptor.
+ switch(diskAdaptor_->getFileAllocationMethod()) {
#ifdef HAVE_SOME_FALLOCATE
- if(diskAdaptor_->doesFallocate()) {
+ case(DiskAdaptor::FILE_ALLOC_FALLOC):
fileAllocationIterator_.reset
(new FallocFileAllocationIterator(entry->getDiskWriter().get(),
entry->size(),
fileEntry->getLength()));
- } else
+ break;
#endif // HAVE_SOME_FALLOCATE
- {
- fileAllocationIterator_.reset
- (new AdaptiveFileAllocationIterator(entry->getDiskWriter().get(),
- entry->size(),
- fileEntry->getLength()));
- }
+ default:
+ fileAllocationIterator_.reset
+ (new AdaptiveFileAllocationIterator(entry->getDiskWriter().get(),
+ entry->size(),
+ fileEntry->getLength()));
+ break;
+ }
}
}
if(finished()) {