diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-12 16:52:53 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-08-12 16:52:53 +0900 |
| commit | d734ff7d298d0abee4e6f75f94afd2d33e0c8fc6 (patch) | |
| tree | 704597e9a322ca8fa85cf3db94ea51299e7fd076 /src/AbstractSingleDiskAdaptor.cc | |
| parent | e2fcd6d72c577688160ce2ae3886edb67416525d (diff) | |
Added new file allocation method called 'trunc'
--file-allocation option can now take new value 'trunc'. 'trunc' uses
ftruncate() system call or platform-specific counterpart to truncate a
file to a specified length.
Diffstat (limited to 'src/AbstractSingleDiskAdaptor.cc')
| -rw-r--r-- | src/AbstractSingleDiskAdaptor.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/AbstractSingleDiskAdaptor.cc b/src/AbstractSingleDiskAdaptor.cc index 2f92655c..f87a6e86 100644 --- a/src/AbstractSingleDiskAdaptor.cc +++ b/src/AbstractSingleDiskAdaptor.cc @@ -37,6 +37,7 @@ #include "AdaptiveFileAllocationIterator.h" #include "DiskWriter.h" #include "FileEntry.h" +#include "TruncFileAllocationIterator.h" #ifdef HAVE_SOME_FALLOCATE # include "FallocFileAllocationIterator.h" #endif // HAVE_SOME_FALLOCATE @@ -107,6 +108,12 @@ AbstractSingleDiskAdaptor::fileAllocationIterator() return h; } #endif // HAVE_SOME_FALLOCATE + case(DiskAdaptor::FILE_ALLOC_TRUNC): { + SharedHandle<TruncFileAllocationIterator> h + (new TruncFileAllocationIterator + (diskWriter_.get(), size(), totalLength_)); + return h; + } default: { SharedHandle<AdaptiveFileAllocationIterator> h (new AdaptiveFileAllocationIterator |
