diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-11 23:38:58 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-11 23:38:58 +0900 |
| commit | e2fcd6d72c577688160ce2ae3886edb67416525d (patch) | |
| tree | 441af2d4f4729f0bd2c7a7f44859770545f07d5b /src/MultiFileAllocationIterator.cc | |
| parent | 27e44439eaa94ec76abc79742d1bd8d122786cda (diff) | |
Use enum to select file allocation method
Diffstat (limited to 'src/MultiFileAllocationIterator.cc')
| -rw-r--r-- | src/MultiFileAllocationIterator.cc | 18 |
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()) { |
