From 29c5ef9215be004b31cd53ef8841680c3f015d57 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Wed, 25 Mar 2009 05:43:07 +0000 Subject: 2009-03-25 Tatsuhiro Tsujikawa Added 'falloc' parameter for --file-allocation option. 'falloc' allocation mode uses posix_fallocate() system call to allocate file on disk. If you are using newer file systems such as ext4 (with extents support), btrfs or xfs, 'falloc' is your best choice. It allocates large(few GiB) files almost instantly. Don't use 'falloc' with legacy file systems such as ext3 because it takes almost same time as 'prealloc' and it blocks aria2 entirely until allocation finishes. 'falloc' may not be available if your system doesn't have posix_fallocate() system call. * configure.ac * src/AbstractDiskWriter.cc * src/AbstractDiskWriter.h * src/AbstractSingleDiskAdaptor.cc * src/BinaryStream.h * src/BtCheckIntegrityEntry.cc * src/ByteArrayDiskWriter.h * src/CheckIntegrityEntry.cc * src/CheckIntegrityEntry.h * src/DefaultPieceStorage.cc * src/DiskAdaptor.cc * src/DiskAdaptor.h * src/DiskWriter.h * src/FallocFileAllocationIterator.cc * src/FallocFileAllocationIterator.h * src/FileAllocationEntry.cc * src/FileAllocationEntry.h * src/Makefile.am * src/MultiFileAllocationIterator.cc * src/MultiFileAllocationIterator.h * src/OptionHandlerFactory.cc * src/RequestGroup.cc * src/StreamCheckIntegrityEntry.cc * src/prefs.cc * src/prefs.h * src/usage_text.h * test/FallocFileAllocationIteratorTest.cc * test/Makefile.am --- src/FileAllocationEntry.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/FileAllocationEntry.cc') diff --git a/src/FileAllocationEntry.cc b/src/FileAllocationEntry.cc index a0e1df05..6a6cd732 100644 --- a/src/FileAllocationEntry.cc +++ b/src/FileAllocationEntry.cc @@ -73,4 +73,9 @@ void FileAllocationEntry::allocateChunk() _fileAllocationIterator->allocateChunk(); } +void FileAllocationEntry::disableDirectIO() +{ + _requestGroup->getPieceStorage()->getDiskAdaptor()->disableDirectIO(); +} + } // namespace aria2 -- cgit