summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2010-04-21 11:41:05 -0400
committerEliot Horowitz <eliot@10gen.com>2010-04-21 11:41:40 -0400
commita0e88a89ead7ecd5c5928f1a2a674c6ae5b62f43 (patch)
treeb7f06cb121c090423ab9d14c0985e233a67834db
parent1561c0a3e2464320b5d810c8c70fd11db55f7c3b (diff)
downloadmongo-a0e88a89ead7ecd5c5928f1a2a674c6ae5b62f43.tar.gz
slightly better followupExtentSize SERVER-1034
-rw-r--r--db/pdfile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/db/pdfile.cpp b/db/pdfile.cpp
index 38842833a62..e46ffb7ce6b 100644
--- a/db/pdfile.cpp
+++ b/db/pdfile.cpp
@@ -925,10 +925,15 @@ namespace mongo {
int x = initialExtentSize(len);
int y = (int) (lastExtentLen < 4000000 ? lastExtentLen * 4.0 : lastExtentLen * 1.2);
int sz = y > x ? y : x;
- if ( sz < lastExtentLen || sz > MaxExtentSize )
+
+ if ( sz < lastExtentLen )
sz = lastExtentLen;
+ else if ( sz > MaxExtentSize )
+ sz = MaxExtentSize;
+
sz = ((int)sz) & 0xffffff00;
assert( sz > len );
+
return sz;
}