diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-03-22 13:23:57 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-03-22 13:23:57 -0400 |
commit | 0cf760ad70962222fbb3c1fc0c3ff1463ec80eb3 (patch) | |
tree | ff288920a36cc0a5ff7f2c441e539080aae9ca41 | |
parent | 87672b83c4cc4517f13c0ce2c35809b89de757bb (diff) | |
download | mongo-0cf760ad70962222fbb3c1fc0c3ff1463ec80eb3.tar.gz |
Inline the block extension function, do a fast check for available
bytes before doing a search.
-rw-r--r-- | src/block/block_ext.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/block/block_ext.c b/src/block/block_ext.c index a4d485b11d7..6c119a36843 100644 --- a/src/block/block_ext.c +++ b/src/block/block_ext.c @@ -427,7 +427,7 @@ __wt_block_off_remove_overlap( * __block_extend -- * Extend the file to allocate space. */ -static int +static inline int __block_extend( WT_SESSION_IMPL *session, WT_BLOCK *block, off_t *offp, off_t size) { @@ -500,6 +500,8 @@ __wt_block_alloc( * * If we don't have anything big enough, extend the file. */ + if (block->live.avail.bytes < size) + goto append; if (block->allocfirst) { if (!__block_first_srch(block->live.avail.off, size, estack)) goto append; |