summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-12-02 23:01:11 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-12-02 23:01:18 +1100
commitf4309efa6d478c1dae79d2483d756c00a069175f (patch)
tree1db61e16f84cc25d2d41a3a8ab2a74f59a8c26d3 /src/third_party/wiredtiger/src/reconcile
parent199111365322182a7c050dbd3cea8bce08885e3f (diff)
downloadmongo-f4309efa6d478c1dae79d2483d756c00a069175f.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.2-rc4-70-g197eef0.tar.gz from wiredtiger branch mongodb-3.2
ref: 7a4f325..197eef0 bff6525 SERVER-21553 Free blocks during reverse splits. c70b097 WT-2253: prioritize WT_READGEN_OLDEST pages for eviction. 4fc3e39 WT-2253 Evict pages left behind by in-memory splits.
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index 0e1e7498568..21cc68ed119 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -985,23 +985,6 @@ __rec_bnd_cleanup(WT_SESSION_IMPL *session, WT_RECONCILE *r, bool destroy)
}
/*
- * __rec_block_free --
- * Helper function to free a block.
- */
-static int
-__rec_block_free(
- WT_SESSION_IMPL *session, const uint8_t *addr, size_t addr_size)
-{
- WT_BM *bm;
- WT_BTREE *btree;
-
- btree = S2BT(session);
- bm = btree->bm;
-
- return (bm->free(bm, session, addr, addr_size));
-}
-
-/*
* __rec_update_save --
* Save a WT_UPDATE list for later restoration.
*/
@@ -1343,8 +1326,6 @@ __rec_child_deleted(WT_SESSION_IMPL *session,
WT_RECONCILE *r, WT_REF *ref, WT_CHILD_STATE *statep)
{
WT_PAGE_DELETED *page_del;
- size_t addr_size;
- const uint8_t *addr;
page_del = ref->page_del;
@@ -1392,11 +1373,8 @@ __rec_child_deleted(WT_SESSION_IMPL *session,
*/
if (ref->addr != NULL &&
(page_del == NULL ||
- __wt_txn_visible_all(session, page_del->txnid))) {
- WT_RET(__wt_ref_info(session, ref, &addr, &addr_size, NULL));
- WT_RET(__rec_block_free(session, addr, addr_size));
- __wt_ref_free_addr(session, ref);
- }
+ __wt_txn_visible_all(session, page_del->txnid)))
+ WT_RET(__wt_ref_block_free(session, ref));
/*
* If the original page is gone, we can skip the slot on the internal
@@ -5312,7 +5290,7 @@ __rec_split_discard(WT_SESSION_IMPL *session, WT_PAGE *page)
if (multi->addr.reuse)
multi->addr.addr = NULL;
else {
- WT_RET(__rec_block_free(session,
+ WT_RET(__wt_btree_block_free(session,
multi->addr.addr, multi->addr.size));
__wt_free(session, multi->addr.addr);
}
@@ -5395,8 +5373,6 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
WT_BTREE *btree;
WT_PAGE_MODIFY *mod;
WT_REF *ref;
- size_t addr_size;
- const uint8_t *addr;
btree = S2BT(session);
bm = btree->bm;
@@ -5421,16 +5397,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
*/
if (__wt_ref_is_root(ref))
break;
- if (ref->addr != NULL) {
- /*
- * Free the page and clear the address (so we don't free
- * it twice).
- */
- WT_RET(__wt_ref_info(
- session, ref, &addr, &addr_size, NULL));
- WT_RET(__rec_block_free(session, addr, addr_size));
- __wt_ref_free_addr(session, ref);
- }
+ WT_RET(__wt_ref_block_free(session, ref));
break;
case WT_PM_REC_EMPTY: /* Page deleted */
break;
@@ -5448,7 +5415,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
* are checkpoints, and must be explicitly dropped.
*/
if (!__wt_ref_is_root(ref))
- WT_RET(__rec_block_free(session,
+ WT_RET(__wt_btree_block_free(session,
mod->mod_replace.addr, mod->mod_replace.size));
/* Discard the replacement page's address. */
@@ -5612,7 +5579,7 @@ __rec_write_wrapup_err(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
if (bnd->addr.reuse)
bnd->addr.addr = NULL;
else {
- WT_TRET(__rec_block_free(session,
+ WT_TRET(__wt_btree_block_free(session,
bnd->addr.addr, bnd->addr.size));
__wt_free(session, bnd->addr.addr);
}