summaryrefslogtreecommitdiff
path: root/util/mmap_posix.cpp
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-15 14:57:37 -0400
committerAaron <aaron@10gen.com>2009-04-15 14:57:37 -0400
commit5d9cb326056703acd0ce2e430b0afc0f3c8799f3 (patch)
tree31f694428b3e2ba2122b0916a053a730a2b3ee5f /util/mmap_posix.cpp
parent0033bd91dfd8846e7f53e4a58c91714fa5b6d99e (diff)
downloadmongo-5d9cb326056703acd0ce2e430b0afc0f3c8799f3.tar.gz
do preallocation after initial allocation too, make file allocator interface more flexible
Diffstat (limited to 'util/mmap_posix.cpp')
-rw-r--r--util/mmap_posix.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/util/mmap_posix.cpp b/util/mmap_posix.cpp
index b351b02392f..aacf993e6f1 100644
--- a/util/mmap_posix.cpp
+++ b/util/mmap_posix.cpp
@@ -51,11 +51,10 @@ namespace mongo {
#endif
void* MemoryMappedFile::map(const char *filename, int length) {
- updateLength( filename, length );
- len = length;
-
+ // length may be updated by callee.
theFileAllocator().allocateAsap( filename, length );
-
+ len = length;
+
fd = open(filename, O_RDWR | O_NOATIME);
if ( fd <= 0 ) {
out() << "couldn't open " << filename << ' ' << errno << endl;