summaryrefslogtreecommitdiff
path: root/util/mmap_posix.cpp
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-15 16:10:34 -0400
committerAaron <aaron@10gen.com>2009-04-15 16:10:34 -0400
commite8c1ce4dc12a841a8e64b3f748c07fc3354ebe01 (patch)
tree0d17dc909bb50e1cb838e88fc517ab65a5ecd874 /util/mmap_posix.cpp
parent89884a1811f30f4bff4156d5ba6ecc3f3b17167f (diff)
downloadmongo-e8c1ce4dc12a841a8e64b3f748c07fc3354ebe01.tar.gz
Revert "Revert "do preallocation after initial allocation too, make file allocator interface more flexible""
This reverts commit 668cf57c520596bb44909027787e4ab9436dd456.
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;