diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/btree/bt_compact.c | 4 | ||||
-rw-r--r-- | src/btree/bt_debug.c | 2 | ||||
-rw-r--r-- | src/btree/bt_discard.c | 2 | ||||
-rw-r--r-- | src/btree/bt_sync.c | 2 | ||||
-rw-r--r-- | src/evict/evict_page.c | 4 | ||||
-rw-r--r-- | src/include/btmem.h | 13 | ||||
-rw-r--r-- | src/include/btree.i | 2 | ||||
-rw-r--r-- | src/reconcile/rec_write.c | 29 |
8 files changed, 29 insertions, 29 deletions
diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c index c85c298d17c..e529050ad31 100644 --- a/src/btree/bt_compact.c +++ b/src/btree/bt_compact.c @@ -44,13 +44,13 @@ __compact_rewrite(WT_SESSION_IMPL *session, WT_REF *ref, bool *skipp) * If the page is a 1-to-1 replacement, test the replacement addresses. * Ignore empty pages, they get merged into the parent. */ - if (mod == NULL || F_MASK(mod, WT_PM_REC_MASK) == 0) { + if (mod == NULL || mod->recon_result == 0) { WT_RET(__wt_ref_info(session, ref, &addr, &addr_size, NULL)); if (addr == NULL) return (0); WT_RET( bm->compact_page_skip(bm, session, addr, addr_size, skipp)); - } else if (F_MASK(mod, WT_PM_REC_MASK) == WT_PM_REC_REPLACE) { + } else if (mod->recon_result == WT_PM_REC_REPLACE) { /* * The page's modification information can change underfoot if * the page is being reconciled, serialize with reconciliation. diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c index f1a22c22b67..bce516ead8b 100644 --- a/src/btree/bt_debug.c +++ b/src/btree/bt_debug.c @@ -651,7 +651,7 @@ __debug_page_metadata(WT_DBG *ds, WT_PAGE *page) __dmsg(ds, ", split-insert"); if (mod != NULL) - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case WT_PM_REC_EMPTY: __dmsg(ds, ", empty"); break; diff --git a/src/btree/bt_discard.c b/src/btree/bt_discard.c index 60c580619e3..89e3ae69a8d 100644 --- a/src/btree/bt_discard.c +++ b/src/btree/bt_discard.c @@ -147,7 +147,7 @@ __free_page_modify(WT_SESSION_IMPL *session, WT_PAGE *page) mod = page->modify; - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case WT_PM_REC_MULTIBLOCK: case WT_PM_REC_REWRITE: /* Free list of replacement blocks. */ diff --git a/src/btree/bt_sync.c b/src/btree/bt_sync.c index 29ae5b185cd..052308b166f 100644 --- a/src/btree/bt_sync.c +++ b/src/btree/bt_sync.c @@ -140,7 +140,7 @@ __sync_file(WT_SESSION_IMPL *session, int syncop) if (!WT_PAGE_IS_INTERNAL(page) && F_ISSET(txn, WT_TXN_HAS_SNAPSHOT) && WT_TXNID_LT(txn->snap_max, mod->first_dirty_txn) && - !F_ISSET(mod, WT_PM_REC_REWRITE)) { + mod->recon_result != WT_PM_REC_REWRITE) { __wt_page_modify_set(session, page); continue; } diff --git a/src/evict/evict_page.c b/src/evict/evict_page.c index e32488a92a6..b09ceb691d5 100644 --- a/src/evict/evict_page.c +++ b/src/evict/evict_page.c @@ -106,7 +106,7 @@ __wt_evict(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) conn->cache->evict_max_page_size = page->memory_footprint; /* Update the reference and discard the page. */ - if (mod == NULL || !F_ISSET(mod, WT_PM_REC_MASK)) { + if (mod == NULL || mod->recon_result == 0) { if (__wt_ref_is_root(ref)) __wt_ref_out(session, ref); else @@ -184,7 +184,7 @@ __evict_page_dirty_update(WT_SESSION_IMPL *session, WT_REF *ref, bool closing) parent = ref->home; mod = ref->page->modify; - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case WT_PM_REC_EMPTY: /* Page is empty */ /* Discard the parent's address. */ if (ref->addr != NULL && __wt_off_page(parent, ref->addr)) { diff --git a/src/include/btmem.h b/src/include/btmem.h index f214ddb1dc3..c49335b5a3d 100644 --- a/src/include/btmem.h +++ b/src/include/btmem.h @@ -387,14 +387,11 @@ struct __wt_page_modify { __wt_spin_unlock((s), &S2C(s)->page_lock[(p)->modify->page_lock]) uint8_t page_lock; /* Page's spinlock */ -#define WT_PM_REC_EMPTY 0x01 /* Reconciliation: no replacement */ -#define WT_PM_REC_MULTIBLOCK 0x02 /* Reconciliation: multiple blocks */ -#define WT_PM_REC_REPLACE 0x04 /* Reconciliation: single block */ -#define WT_PM_REC_REWRITE 0x08 /* Reconciliation: rewrite in place */ -#define WT_PM_REC_MASK \ - (WT_PM_REC_EMPTY | WT_PM_REC_MULTIBLOCK | \ - WT_PM_REC_REPLACE | WT_PM_REC_REWRITE) - uint8_t flags; /* Page flags */ +#define WT_PM_REC_EMPTY 1 /* Reconciliation: no replacement */ +#define WT_PM_REC_MULTIBLOCK 2 /* Reconciliation: multiple blocks */ +#define WT_PM_REC_REPLACE 3 /* Reconciliation: single block */ +#define WT_PM_REC_REWRITE 4 /* Reconciliation: rewrite in place */ + uint8_t recon_result; /* Reconciliation state */ }; /* diff --git a/src/include/btree.i b/src/include/btree.i index 14ebeebad14..658a9145dd8 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -24,7 +24,7 @@ static inline bool __wt_page_is_empty(WT_PAGE *page) { return (page->modify != NULL && - F_MASK(page->modify, WT_PM_REC_MASK) == WT_PM_REC_EMPTY); + page->modify->recon_result == WT_PM_REC_EMPTY); } /* diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c index 491a356d761..8fa1ff9d1c7 100644 --- a/src/reconcile/rec_write.c +++ b/src/reconcile/rec_write.c @@ -624,7 +624,7 @@ __rec_root_write(WT_SESSION_IMPL *session, WT_PAGE *page, uint32_t flags) * write it instead of adding code to write blocks based on the list of * blocks resulting from a multiblock reconciliation. */ - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case WT_PM_REC_EMPTY: /* Page is empty */ case WT_PM_REC_REPLACE: /* 1-for-1 page swap */ case WT_PM_REC_REWRITE: /* Rewrite */ @@ -1499,7 +1499,7 @@ in_memory: * reason to write the cell. */ mod = ref->page->modify; - if (mod != NULL && F_ISSET(mod, WT_PM_REC_MASK)) + if (mod != NULL && mod->recon_result != 0) *statep = WT_CHILD_MODIFIED; else if (ref->addr == NULL) { *statep = WT_CHILD_IGNORE; @@ -3244,7 +3244,8 @@ supd_check_complete: */ bnd_slot = (uint32_t)(bnd - r->bnd); if (bnd_slot > 1 || - (F_ISSET(mod, WT_PM_REC_MULTIBLOCK) && mod->mod_multi != NULL)) { + (mod->recon_result == WT_PM_REC_MULTIBLOCK && + mod->mod_multi != NULL)) { /* * There are page header fields which need to be cleared to get * consistent checksums: specifically, the write generation and @@ -3256,7 +3257,7 @@ supd_check_complete: memset(WT_BLOCK_HEADER_REF(dsk), 0, btree->block_header); bnd->cksum = __wt_cksum(buf->data, buf->size); - if (F_ISSET(mod, WT_PM_REC_MULTIBLOCK) && + if (mod->recon_result == WT_PM_REC_MULTIBLOCK && mod->mod_multi_entries > bnd_slot) { multi = &mod->mod_multi[bnd_slot]; if (multi->size == bnd->size && @@ -3759,7 +3760,7 @@ __rec_col_int(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) * discarded. */ if (state == WT_CHILD_MODIFIED) { - switch (F_MASK(child->modify, WT_PM_REC_MASK)) { + switch (child->modify->recon_result) { case WT_PM_REC_EMPTY: /* * Column-store pages are almost never empty, as @@ -4595,7 +4596,7 @@ __rec_row_int(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) * discarded. */ if (state == WT_CHILD_MODIFIED) - switch (F_MASK(child->modify, WT_PM_REC_MASK)) { + switch (child->modify->recon_result) { case WT_PM_REC_EMPTY: /* * Overflow keys referencing empty pages are no @@ -5310,7 +5311,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) * and clear the underlying modification information, we're creating a * new reality. */ - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case 0: /* * The page has never been reconciled before, free the original * address blocks (if any). The "if any" is for empty trees @@ -5364,7 +5365,9 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) break; WT_ILLEGAL_VALUE(session); } - F_CLR(mod, WT_PM_REC_MASK); + + /* Reset the reconciliation state. */ + mod->recon_result = 0; /* * Wrap up overflow tracking. If we are about to create a checkpoint, @@ -5394,7 +5397,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) * page in memory. If the page is subsequently modified, that * is OK, we'll just reconcile it again. */ - F_SET(mod, WT_PM_REC_EMPTY); + mod->recon_result = WT_PM_REC_EMPTY; break; case 1: /* 1-for-1 page swap */ /* @@ -5420,7 +5423,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) bnd->dsk = NULL; mod->mod_multi_entries = 1; - F_SET(mod, WT_PM_REC_REWRITE); + mod->recon_result = WT_PM_REC_REWRITE; break; } @@ -5437,7 +5440,7 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) bnd->addr.addr = NULL; } - F_SET(mod, WT_PM_REC_REPLACE); + mod->recon_result = WT_PM_REC_REPLACE; break; default: /* Page split */ WT_RET(__wt_verbose(session, WT_VERB_RECONCILE, @@ -5512,7 +5515,7 @@ err: __wt_scr_free(session, &tkey); break; WT_ILLEGAL_VALUE(session); } - F_SET(mod, WT_PM_REC_MULTIBLOCK); + mod->recon_result = WT_PM_REC_MULTIBLOCK; break; } return (0); @@ -5538,7 +5541,7 @@ __rec_write_wrapup_err(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page) * information (otherwise we might think the backing block is being * reused on a subsequent reconciliation where we want to free it). */ - switch (F_MASK(mod, WT_PM_REC_MASK)) { + switch (mod->recon_result) { case WT_PM_REC_MULTIBLOCK: case WT_PM_REC_REWRITE: for (multi = mod->mod_multi, |