diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-03-22 13:23:57 -0400 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2014-03-28 16:16:14 +1100 |
commit | cebc9aa4e70c0e3ca391eef11897ae0047c95070 (patch) | |
tree | 373c335e17599ab8b2ad489e4c225ce73a52f331 | |
parent | cb789a39f3cbef032d9a0ca94af97463a7b44e07 (diff) | |
download | mongo-cebc9aa4e70c0e3ca391eef11897ae0047c95070.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; |