summaryrefslogtreecommitdiff
path: root/src/StreamFileAllocationEntry.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/StreamFileAllocationEntry.cc')
-rw-r--r--src/StreamFileAllocationEntry.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/StreamFileAllocationEntry.cc b/src/StreamFileAllocationEntry.cc
index c6d1de2a..e02bbc48 100644
--- a/src/StreamFileAllocationEntry.cc
+++ b/src/StreamFileAllocationEntry.cc
@@ -66,7 +66,9 @@ void StreamFileAllocationEntry::prepareForNextAction(
// RequestGroup::createInitialCommand()
getRequestGroup()->getDownloadContext()->resetDownloadStartTime();
if (option->getAsBool(PREF_ENABLE_MMAP) &&
- option->get(PREF_FILE_ALLOCATION) != V_NONE) {
+ option->get(PREF_FILE_ALLOCATION) != V_NONE &&
+ getRequestGroup()->getPieceStorage()->getDiskAdaptor()->size() <=
+ option->getAsLLInt(PREF_MAX_MMAP_LIMIT)) {
getRequestGroup()->getPieceStorage()->getDiskAdaptor()->enableMmap();
}
if (getNextCommand()) {