8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 22:03:03 +01:00

Let's not hide the line number of a particular bugcheck call behind a dummy function.

This commit is contained in:
dimitr 2008-10-14 13:09:48 +00:00
parent e0db5f3ecd
commit 5ac621c954

View File

@ -105,7 +105,6 @@ static BufferDesc* alloc_bdb(thread_db*, BufferControl*, UCHAR **);
static Lock* alloc_page_lock(Jrd::thread_db*, BufferDesc*);
static int blocking_ast_bdb(void*);
#endif
static void cache_bugcheck(int);
#ifdef CACHE_READER
static THREAD_ENTRY_DECLARE cache_reader(THREAD_ENTRY_PARAM);
#endif
@ -1330,10 +1329,10 @@ void CCH_flush(thread_db* tdbb, USHORT flush_flag, SLONG tra_number)
}
if (latch_bdb(tdbb, latch, bdb, bdb->bdb_page, 1) == -1)
{
cache_bugcheck(302); // msg 302 unexpected page change
BUGCHECK(302); // msg 302 unexpected page change
}
if (bdb->bdb_use_count > 1)
cache_bugcheck(210); // msg 210 page in use during flush
BUGCHECK(210); // msg 210 page in use during flush
#ifdef SUPERSERVER
if (bdb->bdb_flags & BDB_db_dirty) {
if (all_flag
@ -1799,7 +1798,7 @@ void CCH_mark(thread_db* tdbb, WIN * window, USHORT mark_system, USHORT must_wri
This prevents a write while the page is being modified. */
if (latch_bdb(tdbb, LATCH_mark, bdb, bdb->bdb_page, 1) == -1) {
cache_bugcheck(302); /* msg 302 unexpected page change */
BUGCHECK(302); /* msg 302 unexpected page change */
}
bdb->bdb_incarnation = ++dbb->dbb_page_incarnation;
@ -2377,7 +2376,7 @@ void CCH_unwind(thread_db* tdbb, const bool punt)
}
if (bdb->bdb_exclusive == tdbb) {
if (bdb->bdb_flags & BDB_marked) {
cache_bugcheck(268); /* msg 268 buffer marked during cache unwind */
BUGCHECK(268); /* msg 268 buffer marked during cache unwind */
}
bdb->bdb_flags &= ~(BDB_writer | BDB_faked | BDB_must_write);
release_bdb(tdbb, bdb, true, false, false);
@ -2865,10 +2864,10 @@ static void flushAll(thread_db* tdbb, USHORT flush_flag)
else if (release_flag)
{
if (latch_bdb(tdbb, latch, bdb, bdb->bdb_page, 1) == -1) {
cache_bugcheck(302); // msg 302 unexpected page change
BUGCHECK(302); // msg 302 unexpected page change
}
if (bdb->bdb_use_count > 1) {
cache_bugcheck(210); // msg 210 page in use during flush
BUGCHECK(210); // msg 210 page in use during flush
}
PAGE_LOCK_RELEASE(bdb->bdb_lock);
release_bdb(tdbb, bdb, false, false, false);
@ -2894,10 +2893,10 @@ static void flushAll(thread_db* tdbb, USHORT flush_flag)
if (release_flag)
{
if (latch_bdb(tdbb, latch, bdb, bdb->bdb_page, 1) == -1) {
cache_bugcheck(302); // msg 302 unexpected page change
BUGCHECK(302); // msg 302 unexpected page change
}
if (bdb->bdb_use_count > 1) {
cache_bugcheck(210); // msg 210 page in use during flush
BUGCHECK(210); // msg 210 page in use during flush
}
}
if (bdb->bdb_flags & (BDB_db_dirty | BDB_dirty))
@ -3449,7 +3448,7 @@ static void btc_remove_balanced(BufferDesc* bdb)
return;
}
cache_bugcheck(211);
BUGCHECK(211);
/* msg 211 attempt to remove page from dirty page list when not there */
}
@ -3494,7 +3493,7 @@ static void btc_remove_balanced(BufferDesc* bdb)
// node not found, bad tree
if (!p)
{
cache_bugcheck(211);
BUGCHECK(211);
}
}
@ -3502,7 +3501,7 @@ static void btc_remove_balanced(BufferDesc* bdb)
if (bdb != p)
{
cache_bugcheck(211);
BUGCHECK(211);
}
/* delete node */
@ -3548,7 +3547,7 @@ static void btc_remove_balanced(BufferDesc* bdb)
{
if (stack[stackp].comp > 0)
{
cache_bugcheck(211);
BUGCHECK(211);
}
if ( (p->bdb_parent = bdb->bdb_parent) )
@ -3890,7 +3889,7 @@ static void btc_remove_unbalanced(BufferDesc* bdb)
return;
}
cache_bugcheck(211);
BUGCHECK(211);
/* msg 211 attempt to remove page from dirty page list when not there */
}
@ -3937,22 +3936,6 @@ static void btc_remove_unbalanced(BufferDesc* bdb)
#endif // DIRTY_TREE
static void cache_bugcheck(int number)
{
/**************************************
*
* c a c h e _ b u g c h e c k
*
**************************************
*
* Functional description
* There has been a bugcheck during a cache operation. Release
* the cache mutex and post the bugcheck.
*
**************************************/
BUGCHECK(number);
}
#ifdef CACHE_READER
static THREAD_ENTRY_DECLARE cache_reader(THREAD_ENTRY_PARAM arg)
@ -4340,7 +4323,7 @@ static void check_precedence(thread_db* tdbb, WIN * window, PageNumber page)
BufferDesc* low = window->win_bdb;
if ((low->bdb_flags & BDB_marked) && !(low->bdb_flags & BDB_faked))
cache_bugcheck(212); /* msg 212 CCH_precedence: block marked */
BUGCHECK(212); /* msg 212 CCH_precedence: block marked */
/* If already related, there's nothing more to do. If the precedence
search was too complex to complete, just write the high page and
@ -4905,7 +4888,7 @@ static BufferDesc* get_buffer(thread_db* tdbb, const PageNumber page, LATCH latc
clear though how the bdb_use_count can get < 0 for a bdb
in bcb_empty queue */
if (bdb->bdb_use_count < 0) {
cache_bugcheck(301); /* msg 301 Non-zero use_count of a buffer in the empty que_inst */
BUGCHECK(301); /* msg 301 Non-zero use_count of a buffer in the empty que_inst */
}
bdb->bdb_page = page;
@ -4914,7 +4897,7 @@ static BufferDesc* get_buffer(thread_db* tdbb, const PageNumber page, LATCH latc
/* The following latch should never fail because the buffer is 'empty'
and the page is not in cache. */
if (latch_bdb(tdbb, latch, bdb, page, -100) == -1) {
cache_bugcheck(302); /* msg 302 unexpected page change */
BUGCHECK(302); /* msg 302 unexpected page change */
}
#ifndef SUPERSERVER
if (page.getPageNum() >= 0) {
@ -4935,7 +4918,7 @@ static BufferDesc* get_buffer(thread_db* tdbb, const PageNumber page, LATCH latc
that since there are no empty buffers this queue cannot be empty */
if (bcb->bcb_in_use.que_forward == &bcb->bcb_in_use) {
cache_bugcheck(213); /* msg 213 insufficient cache size */
BUGCHECK(213); /* msg 213 insufficient cache size */
}
BufferDesc* oldest = BLOCK(que_inst, BufferDesc*, bdb_in_use);
@ -5061,7 +5044,7 @@ static BufferDesc* get_buffer(thread_db* tdbb, const PageNumber page, LATCH latc
#ifdef SUPERSERVER
expand_buffers(tdbb, bcb->bcb_count + 75);
#else
cache_bugcheck(214); /* msg 214 no cache buffers available for reuse */
BUGCHECK(214); /* msg 214 no cache buffers available for reuse */
#endif
}
}
@ -5146,7 +5129,7 @@ static SSHORT latch_bdb(
bdb->bdb_io = tdbb;
break;
case LATCH_mark:
cache_bugcheck(295); /* inconsistent LATCH_mark call */
BUGCHECK(295); /* inconsistent LATCH_mark call */
break;
case LATCH_none:
break;
@ -5237,7 +5220,7 @@ static SSHORT latch_bdb(
case LATCH_mark:
if (bdb->bdb_exclusive != tdbb) {
cache_bugcheck(295); /* inconsistent LATCH_mark call */
BUGCHECK(295); /* inconsistent LATCH_mark call */
}
/* Some Firebird code marks a buffer more than once. */
if (bdb->bdb_io && (bdb->bdb_io != tdbb)) {
@ -5871,7 +5854,7 @@ static void release_bdb(thread_db* tdbb,
/* Releasing a LATCH_mark. */
if (rel_mark_latch) {
if ((bdb->bdb_io != tdbb) || (bdb->bdb_exclusive != tdbb)) {
cache_bugcheck(294); /* inconsistent LATCH_mark release */
BUGCHECK(294); /* inconsistent LATCH_mark release */
}
bdb->bdb_io = 0;
}
@ -5882,7 +5865,7 @@ static void release_bdb(thread_db* tdbb,
If an actual state changed, then we need to check if waiters
can be granted. Otherwise, there is nothing further to do. */
if (bdb->bdb_io == tdbb) {
cache_bugcheck(296); /* inconsistent latch downgrade call */
BUGCHECK(296); /* inconsistent latch downgrade call */
}
if (bdb->bdb_exclusive == tdbb) {
bdb->bdb_exclusive = 0;
@ -5933,7 +5916,7 @@ static void release_bdb(thread_db* tdbb,
/* If the exclusive latch is not held, then things have to behave much nicer. */
{
if (bdb->bdb_flags & BDB_marked) {
cache_bugcheck(297); /* bdb is unexpectedly marked */
BUGCHECK(297); /* bdb is unexpectedly marked */
}
--bdb->bdb_use_count;
if (bdb->bdb_io == tdbb) {
@ -5942,7 +5925,7 @@ static void release_bdb(thread_db* tdbb,
else {
SharedLatch* latch = findSharedLatch(tdbb, bdb);
if (!latch) {
cache_bugcheck(300); /* can't find shared latch */
BUGCHECK(300); /* can't find shared latch */
}
freeSharedLatch(tdbb, bdb->bdb_dbb->dbb_bcb, latch);
}
@ -5982,7 +5965,7 @@ static void release_bdb(thread_db* tdbb,
case LATCH_mark:
if (bdb->bdb_exclusive != lwt->lwt_tdbb) {
cache_bugcheck(298); /* missing exclusive latch */
BUGCHECK(298); /* missing exclusive latch */
}
if (!bdb->bdb_io)
{
@ -6192,7 +6175,7 @@ static int write_buffer(
}
if ((bdb->bdb_flags & BDB_marked) && !(bdb->bdb_flags & BDB_faked)) {
cache_bugcheck(217); /* msg 217 buffer marked for update */
BUGCHECK(217); /* msg 217 buffer marked for update */
}
if (!(bdb->bdb_flags & BDB_dirty) &&