From afd499a7091dab914463692dcc442a308740e33c Mon Sep 17 00:00:00 2001 From: Michael Cahill Date: Fri, 19 Dec 2014 17:27:51 +1100 Subject: Remove the SET/CLEAR_BTREE_IN_SESSION macros: now we have WT_WITH_DHANDLE, they don't make much sense. --- src/conn/conn_dhandle.c | 2 +- src/include/dhandle.h | 13 ------------- src/lsm/lsm_worker.c | 6 ++++-- src/schema/schema_drop.c | 4 ++-- 4 files changed, 7 insertions(+), 18 deletions(-) diff --git a/src/conn/conn_dhandle.c b/src/conn/conn_dhandle.c index 6d331f691fd..184fac26d7c 100644 --- a/src/conn/conn_dhandle.c +++ b/src/conn/conn_dhandle.c @@ -716,7 +716,7 @@ __wt_conn_dhandle_discard_single(WT_SESSION_IMPL *session, int final) __wt_spin_destroy(session, &dhandle->close_lock); __wt_overwrite_and_free(session, dhandle); - WT_CLEAR_BTREE_IN_SESSION(session); + session->dhandle = NULL; } return (ret); diff --git a/src/include/dhandle.h b/src/include/dhandle.h index 8cd7c9ba90b..1a6839b11fe 100644 --- a/src/include/dhandle.h +++ b/src/include/dhandle.h @@ -5,19 +5,6 @@ * See the file LICENSE for redistribution information. */ -/* - * XXX - * The server threads use their own WT_SESSION_IMPL handles because they may - * want to block (for example, the eviction server calls reconciliation, and - * some of the reconciliation diagnostic code reads pages), and the user's - * session handle is already blocking on a server thread. The problem is the - * server thread needs to reference the correct btree handle, and that's - * hanging off the application's thread of control. For now, I'm just making - * it obvious where that's getting done. - */ -#define WT_SET_BTREE_IN_SESSION(s, b) ((s)->dhandle = b->dhandle) -#define WT_CLEAR_BTREE_IN_SESSION(s) ((s)->dhandle = NULL) - #define WT_WITH_DHANDLE(s, d, e) do { \ WT_DATA_HANDLE *__saved_dhandle = (s)->dhandle; \ (s)->dhandle = (d); \ diff --git a/src/lsm/lsm_worker.c b/src/lsm/lsm_worker.c index 955dd09193b..703453305ba 100644 --- a/src/lsm/lsm_worker.c +++ b/src/lsm/lsm_worker.c @@ -141,8 +141,10 @@ __lsm_worker(void *arg) ret = 0; } else if (ret == EBUSY) ret = 0; - /* Clear any state */ - WT_CLEAR_BTREE_IN_SESSION(session); + + /* Paranoia: clear session state. */ + session->dhandle = NULL; + __wt_lsm_manager_free_work_unit(session, entry); entry = NULL; progress = 1; diff --git a/src/schema/schema_drop.c b/src/schema/schema_drop.c index ca09d25a495..9a74b26ffec 100644 --- a/src/schema/schema_drop.c +++ b/src/schema/schema_drop.c @@ -165,8 +165,8 @@ __wt_schema_drop(WT_SESSION_IMPL *session, const char *uri, const char *cfg[]) WT_RET(__wt_meta_track_on(session)); - /* Be careful to ignore any btree handle in our caller. */ - WT_CLEAR_BTREE_IN_SESSION(session); + /* Paranoia: clear any handle from our caller. */ + session->dhandle = NULL; if (WT_PREFIX_MATCH(uri, "colgroup:")) ret = __drop_colgroup(session, uri, force, cfg); -- cgit v1.2.1