summaryrefslogtreecommitdiff
path: root/src/conn/conn_dhandle.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/conn/conn_dhandle.c')
-rw-r--r--src/conn/conn_dhandle.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c
index 76f55fa44e5..92497484408 100644
--- a/src/conn/conn_dhandle.c
+++ b/src/conn/conn_dhandle.c
@@ -55,6 +55,8 @@ __conn_dhandle_alloc(WT_SESSION_IMPL *session,
WT_ERR(__wt_spin_init(
session, &dhandle->close_lock, "data handle close"));
+ __wt_stat_dsrc_init(dhandle);
+
*dhandlep = dhandle;
return (0);
@@ -81,7 +83,7 @@ __wt_conn_dhandle_find(
bucket = __wt_hash_city64(uri, strlen(uri)) % WT_HASH_ARRAY_SIZE;
if (checkpoint == NULL) {
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ TAILQ_FOREACH(dhandle, &conn->dhhash[bucket], hashq) {
if (F_ISSET(dhandle, WT_DHANDLE_DEAD))
continue;
if (dhandle->checkpoint == NULL &&
@@ -91,7 +93,7 @@ __wt_conn_dhandle_find(
}
}
} else
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ TAILQ_FOREACH(dhandle, &conn->dhhash[bucket], hashq) {
if (F_ISSET(dhandle, WT_DHANDLE_DEAD))
continue;
if (dhandle->checkpoint != NULL &&
@@ -404,7 +406,7 @@ __wt_conn_btree_apply(WT_SESSION_IMPL *session,
if (uri != NULL) {
bucket =
__wt_hash_city64(uri, strlen(uri)) % WT_HASH_ARRAY_SIZE;
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl)
+ TAILQ_FOREACH(dhandle, &conn->dhhash[bucket], hashq)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
!F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
strcmp(uri, dhandle->name) == 0 &&
@@ -412,7 +414,7 @@ __wt_conn_btree_apply(WT_SESSION_IMPL *session,
WT_RET(__conn_btree_apply_internal(
session, dhandle, func, cfg));
} else {
- SLIST_FOREACH(dhandle, &conn->dhlh, l)
+ TAILQ_FOREACH(dhandle, &conn->dhqh, q)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
!F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
(apply_checkpoints ||
@@ -489,7 +491,7 @@ __wt_conn_btree_apply_single(WT_SESSION_IMPL *session,
hash = __wt_hash_city64(uri, strlen(uri));
bucket = hash % WT_HASH_ARRAY_SIZE;
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl)
+ TAILQ_FOREACH(dhandle, &conn->dhhash[bucket], hashq)
if (F_ISSET(dhandle, WT_DHANDLE_OPEN) &&
!F_ISSET(dhandle, WT_DHANDLE_DEAD) &&
(hash == dhandle->name_hash &&
@@ -538,7 +540,7 @@ __wt_conn_dhandle_close_all(
WT_ASSERT(session, session->dhandle == NULL);
bucket = __wt_hash_city64(uri, strlen(uri)) % WT_HASH_ARRAY_SIZE;
- SLIST_FOREACH(dhandle, &conn->dhhash[bucket], hashl) {
+ TAILQ_FOREACH(dhandle, &conn->dhhash[bucket], hashq) {
if (strcmp(dhandle->name, uri) != 0 ||
F_ISSET(dhandle, WT_DHANDLE_DEAD))
continue;
@@ -596,6 +598,7 @@ __conn_dhandle_remove(WT_SESSION_IMPL *session, int final)
bucket = dhandle->name_hash % WT_HASH_ARRAY_SIZE;
WT_ASSERT(session, F_ISSET(session, WT_SESSION_LOCKED_HANDLE_LIST));
+ WT_ASSERT(session, dhandle != conn->cache->evict_file_next);
/* Check if the handle was reacquired by a session while we waited. */
if (!final &&
@@ -675,7 +678,7 @@ __wt_conn_dhandle_discard(WT_SESSION_IMPL *session)
* the list, so we do it the hard way.
*/
restart:
- SLIST_FOREACH(dhandle, &conn->dhlh, l) {
+ TAILQ_FOREACH(dhandle, &conn->dhqh, q) {
if (WT_IS_METADATA(dhandle))
continue;
@@ -694,7 +697,7 @@ restart:
F_SET(session, WT_SESSION_NO_DATA_HANDLES);
/* Close the metadata file handle. */
- while ((dhandle = SLIST_FIRST(&conn->dhlh)) != NULL)
+ while ((dhandle = TAILQ_FIRST(&conn->dhqh)) != NULL)
WT_WITH_DHANDLE(session, dhandle,
WT_TRET(__wt_conn_dhandle_discard_single(session, 1, 0)));