diff options
author | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-03-09 17:48:07 +1100 |
---|---|---|
committer | Michael Cahill <michael.cahill@wiredtiger.com> | 2012-03-09 17:48:07 +1100 |
commit | 2683c452b0910e5d61a32a368d10ee4f9314f0bc (patch) | |
tree | 57e933a9e994c9e7b0351cbeeef72425282a66e0 | |
parent | b22ab91cda57ac5794d0a0af12ea160be01127c8 (diff) | |
download | mongo-2683c452b0910e5d61a32a368d10ee4f9314f0bc.tar.gz |
Get rid of the pinned flag: it is no longer used.
-rw-r--r-- | src/btree/bt_debug.c | 2 | ||||
-rw-r--r-- | src/btree/bt_evict.c | 2 | ||||
-rw-r--r-- | src/btree/bt_handle.c | 4 | ||||
-rw-r--r-- | src/btree/bt_page.c | 4 | ||||
-rw-r--r-- | src/include/btmem.h | 9 | ||||
-rw-r--r-- | src/include/btree.i | 2 | ||||
-rw-r--r-- | src/include/cache.i | 2 |
7 files changed, 9 insertions, 16 deletions
diff --git a/src/btree/bt_debug.c b/src/btree/bt_debug.c index 357c724a618..69089a0e209 100644 --- a/src/btree/bt_debug.c +++ b/src/btree/bt_debug.c @@ -444,8 +444,6 @@ __debug_page_hdr(WT_DBG *ds, WT_PAGE *page) __dmsg(ds, " (%s", __wt_page_is_modified(page) ? "dirty" : "clean"); if (F_ISSET(page, WT_PAGE_BUILD_KEYS)) __dmsg(ds, ", keys-built"); - if (F_ISSET(page, WT_PAGE_PINNED)) - __dmsg(ds, ", pinned"); if (F_ISSET(page, WT_PAGE_REC_EMPTY)) __dmsg(ds, ", empty"); if (F_ISSET(page, WT_PAGE_REC_REPLACE)) diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c index 118f17882f0..2560faaf4a1 100644 --- a/src/btree/bt_evict.c +++ b/src/btree/bt_evict.c @@ -585,7 +585,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp) * It's still in flux if root pages are pinned or not, test for * both cases for now. */ - if (WT_PAGE_IS_ROOT(page) || F_ISSET(page, WT_PAGE_PINNED)) + if (WT_PAGE_IS_ROOT(page)) goto skip; /* diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c index 6d3c6ee4f5e..dc7fe043459 100644 --- a/src/btree/bt_handle.c +++ b/src/btree/bt_handle.c @@ -254,9 +254,6 @@ __wt_btree_root_init(WT_SESSION_IMPL *session, WT_ITEM *addr) /* Build the in-memory version of the page. */ WT_ERR(__wt_page_inmem(session, NULL, NULL, tmp.mem, NULL, &page)); - /* This page can never leave memory. */ - F_SET(page, WT_PAGE_PINNED); - btree->root_page = page; return (0); @@ -340,7 +337,6 @@ __btree_root_init_empty(WT_SESSION_IMPL *session) root->entries = 1; root->parent = NULL; root->ref = NULL; - F_SET(root, WT_PAGE_PINNED); leaf->ref = ref; leaf->parent = root; diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c index 66de3493f3b..97f565571e3 100644 --- a/src/btree/bt_page.c +++ b/src/btree/bt_page.c @@ -57,12 +57,12 @@ __wt_page_in_func( * can't get a hazard reference is because the page is * being evicted; yield and try again. */ - if (F_ISSET(ref->page, WT_PAGE_PINNED) || - __wt_hazard_set(session, ref + if (__wt_hazard_set(session, ref #ifdef HAVE_DIAGNOSTIC , file, line #endif ) == 0) { + WT_ASSERT(session, !WT_PAGE_IS_ROOT(ref->page)); ref->page->read_gen = __wt_cache_read_gen(session); return (0); diff --git a/src/include/btmem.h b/src/include/btmem.h index 2c7770df3aa..8e3c1986992 100644 --- a/src/include/btmem.h +++ b/src/include/btmem.h @@ -292,11 +292,10 @@ struct __wt_page { * the threads could race. */ #define WT_PAGE_BUILD_KEYS 0x001 /* Keys have been built in memory */ -#define WT_PAGE_PINNED 0x002 /* Page is pinned */ -#define WT_PAGE_REC_EMPTY 0x004 /* Reconciliation: page empty */ -#define WT_PAGE_REC_REPLACE 0x008 /* Reconciliation: page replaced */ -#define WT_PAGE_REC_SPLIT 0x010 /* Reconciliation: page split */ -#define WT_PAGE_REC_SPLIT_MERGE 0x020 /* Reconciliation: page split merge */ +#define WT_PAGE_REC_EMPTY 0x002 /* Reconciliation: page empty */ +#define WT_PAGE_REC_REPLACE 0x004 /* Reconciliation: page replaced */ +#define WT_PAGE_REC_SPLIT 0x008 /* Reconciliation: page split */ +#define WT_PAGE_REC_SPLIT_MERGE 0x010 /* Reconciliation: page split merge */ uint8_t flags; /* Page flags */ }; diff --git a/src/include/btree.i b/src/include/btree.i index a720111304a..5cee53d2fe4 100644 --- a/src/include/btree.i +++ b/src/include/btree.i @@ -203,7 +203,7 @@ __wt_get_addr( static inline void __wt_page_release(WT_SESSION_IMPL *session, WT_PAGE *page) { - if (page != NULL && !F_ISSET(page, WT_PAGE_PINNED)) + if (page != NULL && !WT_PAGE_IS_ROOT(page)) __wt_hazard_clear(session, page); } diff --git a/src/include/cache.i b/src/include/cache.i index 31c0cf1129b..866f00693c2 100644 --- a/src/include/cache.i +++ b/src/include/cache.i @@ -51,7 +51,7 @@ __wt_eviction_page_check(WT_SESSION_IMPL *session, WT_PAGE *page) * Otherwise, if the cache is more than 95% full, wake up the eviction * thread. */ - if (page != NULL && !F_ISSET(page, WT_PAGE_PINNED) && + if (page != NULL && !WT_PAGE_IS_ROOT(page) && (((int64_t)page->memory_footprint > conn->cache_size / 2) || (page->memory_footprint > 20 * session->btree->maxleafpage))) { /* |