diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-12-28 17:17:22 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-12-28 17:17:22 +0000 |
commit | bb26b9c7a1b96c25258d24488909449abd831edd (patch) | |
tree | 1e6c223cb664847cedf6965c48efd120ae1c2b86 | |
parent | 2ada60ea4f0be1648b8f4098852f7275638f33f6 (diff) | |
download | mongo-bb26b9c7a1b96c25258d24488909449abd831edd.tar.gz |
Simplify WT_PANIC_XXX and friends.
I needed a return version, which made 3, but we only have 2 cases: (1)
one that returns WT_PANIC without any error value for the associated
message, and (2) one that doesn't return WT_PANIC (ever), but does have
an error value for the associated message.
Case #1 is now WT_PANIC_ERR, case #2 is WT_PANIC_RETX, and that leaves
WT_PANIC_ERRX for a version that doesn't return WT_PANIC (ever) but does
have an error value for the associated message, and WT_PANIC_RET for a
version that returns WT_PANIC and has an error value for the associated
message, if we ever need them.
-rw-r--r-- | src/btree/bt_evict.c | 2 | ||||
-rw-r--r-- | src/btree/rec_write.c | 4 | ||||
-rw-r--r-- | src/include/error.h | 16 | ||||
-rw-r--r-- | src/support/hazard.c | 3 |
4 files changed, 9 insertions, 16 deletions
diff --git a/src/btree/bt_evict.c b/src/btree/bt_evict.c index 682aa9d9a2e..82c2ca48c52 100644 --- a/src/btree/bt_evict.c +++ b/src/btree/bt_evict.c @@ -870,7 +870,7 @@ __evict_walk_file(WT_SESSION_IMPL *session, u_int *slotp, int clean) * with the checkpointing thread. This test isn't sufficient * by itself because the page might be modified after we select * it and before we get exclusive access, this test has to be - * repeated durnig the page eviction review. + * repeated during the page eviction review. */ modified = __wt_page_is_modified(page); if (modified && btree->writes_disabled) diff --git a/src/btree/rec_write.c b/src/btree/rec_write.c index e868d46f997..041a61feea1 100644 --- a/src/btree/rec_write.c +++ b/src/btree/rec_write.c @@ -450,8 +450,8 @@ __rec_txn_read( r->upd_skipped = 1; switch (F_ISSET(r, WT_SKIP_UPDATE_ERR | WT_SKIP_UPDATE_QUIT)) { case WT_SKIP_UPDATE_ERR: - WT_PANIC_RET(session, - EBUSY, "reconciliation illegally skipped an update"); + WT_PANIC_RETX( + session, "reconciliation illegally skipped an update"); case WT_SKIP_UPDATE_QUIT: return (EBUSY); case 0: diff --git a/src/include/error.h b/src/include/error.h index c6898d0716b..6ec8ad385b2 100644 --- a/src/include/error.h +++ b/src/include/error.h @@ -78,19 +78,13 @@ } while (0) #define WT_PANIC_ERR(session, v, ...) do { \ - __wt_err((session), (v), __VA_ARGS__); \ - /* Return WT_PANIC regardless of earlier return codes. */ \ - (v) = __wt_panic((session)); \ -} while (0) -#define WT_PANIC_ERRX(session, ...) do { \ - __wt_errx((session), __VA_ARGS__); \ - /* Return WT_PANIC regardless of earlier return codes. */ \ - (void)__wt_panic((session)); \ + __wt_err(session, v, __VA_ARGS__); \ + (void)__wt_panic(session); \ } while (0) -#define WT_PANIC_RET(session, v, ...) do { \ - __wt_err((session), (v), __VA_ARGS__); \ +#define WT_PANIC_RETX(session, ...) do { \ + __wt_errx(session, __VA_ARGS__); \ /* Return WT_PANIC regardless of earlier return codes. */ \ - return (__wt_panic((session))); \ + return (__wt_panic(session)); \ } while (0) /* diff --git a/src/support/hazard.c b/src/support/hazard.c index 7eb0cf4e5bc..29d15c2c9ad 100644 --- a/src/support/hazard.c +++ b/src/support/hazard.c @@ -170,9 +170,8 @@ __wt_hazard_clear(WT_SESSION_IMPL *session, WT_PAGE *page) * A serious error, we should always find the hazard pointer. Panic, * because using a page we didn't have pinned down implies corruption. */ - WT_PANIC_ERRX(session, + WT_PANIC_RETX(session, "session %p: clear hazard pointer: %p: not found", session, page); - return (WT_PANIC); } /* |