diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2013-05-14 13:01:34 +1000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2013-05-14 13:01:34 +1000 |
commit | acbdc1cd4983ef887ee50e364e8b899bcf5ec716 (patch) | |
tree | 6b5c43a6324043a073293f460e88ffaa493f3bec /src/block/block_read.c | |
parent | 467ebb699f537322ff765d900c5f1cf0b4973016 (diff) | |
download | mongo-acbdc1cd4983ef887ee50e364e8b899bcf5ec716.tar.gz |
Preload internal pages into file system cache with compression.
Previously the functionality only worked without compression enabled.
Diffstat (limited to 'src/block/block_read.c')
-rw-r--r-- | src/block/block_read.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/block/block_read.c b/src/block/block_read.c index bfb39dc567d..bbbd572bd8f 100644 --- a/src/block/block_read.c +++ b/src/block/block_read.c @@ -16,9 +16,10 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, WT_ITEM *buf, const uint8_t *addr, uint32_t addr_size) { WT_BLOCK *block; - off_t offset; - uint32_t size, cksum; int mapped; + off_t offset; + uint32_t cksum, size; + size_t preload_size; WT_UNUSED(addr_size); block = bm->block; @@ -49,7 +50,9 @@ __wt_bm_read(WT_BM *bm, WT_SESSION_IMPL *session, buf->size = size; F_SET(buf, WT_ITEM_MAPPED); - WT_RET(__wt_mmap_preload(session, buf->mem, buf->size)); + preload_size = F_ISSET(session, WT_SESSION_PRELOAD_PAGES) ? + bm->maplen - offset : buf->size; + WT_RET(__wt_mmap_preload(session, buf->mem, preload_size)); WT_CSTAT_INCR(session, block_map_read); WT_CSTAT_INCRV(session, block_byte_map_read, size); |