8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 02:43:03 +01:00
This commit is contained in:
robocop 2008-03-29 13:01:49 +00:00
parent 85a809ada6
commit 882955f5c3
2 changed files with 21 additions and 20 deletions

View File

@ -633,6 +633,7 @@ pag* CCH_fake(thread_db* tdbb, WIN * window, SSHORT latch_wait)
SET_TDBB(tdbb);
Database* dbb = tdbb->getDatabase();
// This var is unused.
const SLONG attachment_lock_handle = BackupManager::attachment_lock_handle(tdbb);
if (window->win_page == HEADER_PAGE_NUMBER)
dbb->dbb_backup_manager->lock_shared_database(tdbb, true);
@ -699,7 +700,7 @@ pag* CCH_fetch(
SCHAR page_type,
SSHORT checksum,
SSHORT latch_wait,
bool read_shadow)
const bool read_shadow)
{
/**************************************
*
@ -881,7 +882,7 @@ SSHORT CCH_fetch_lock(
void CCH_fetch_page(
thread_db* tdbb,
WIN * window,
SSHORT compute_checksum, bool read_shadow)
SSHORT compute_checksum, const bool read_shadow)
{
/**************************************
*
@ -1526,7 +1527,7 @@ pag* CCH_handoff(
SSHORT lock,
SCHAR page_type,
SSHORT latch_wait,
SSHORT release_tail)
const bool release_tail)
{
/**************************************
*
@ -1799,7 +1800,7 @@ void CCH_mark(thread_db* tdbb, WIN * window, USHORT mark_system, USHORT must_wri
const SLONG attachment_lock_owner = BackupManager::attachment_lock_handle(tdbb);
bool was_marked = bdb->bdb_flags & BDB_marked;
const bool was_marked = bdb->bdb_flags & BDB_marked;
if (!was_marked)
dbb->dbb_backup_manager->checkout_dirty_page(tdbb, attachment_lock_owner);
@ -1852,7 +1853,7 @@ void CCH_mark(thread_db* tdbb, WIN * window, USHORT mark_system, USHORT must_wri
bdb->bdb_flags |= BDB_db_dirty;
#endif
bool was_dirty = bdb->bdb_flags & BDB_dirty;
const bool was_dirty = bdb->bdb_flags & BDB_dirty;
bdb->bdb_flags |= (BDB_dirty | BDB_marked);
if (must_write || dbb->dbb_backup_manager->database_flush_in_progress())
@ -2110,7 +2111,7 @@ void set_diff_page(thread_db* tdbb, BufferDesc* bdb)
}
}
void CCH_release(thread_db* tdbb, WIN * window, bool release_tail)
void CCH_release(thread_db* tdbb, WIN * window, const bool release_tail)
{
/**************************************
*
@ -2150,7 +2151,7 @@ void CCH_release(thread_db* tdbb, WIN * window, bool release_tail)
if (bdb->bdb_use_count == 1)
{
bool marked = bdb->bdb_flags & BDB_marked;
const bool marked = bdb->bdb_flags & BDB_marked;
bdb->bdb_flags &= ~(BDB_writer | BDB_marked | BDB_faked);
if (bdb->bdb_page == HEADER_PAGE_NUMBER) {
@ -2367,7 +2368,7 @@ void CCH_shutdown_database(Database* dbb)
#endif
}
void CCH_unwind(thread_db* tdbb, bool punt)
void CCH_unwind(thread_db* tdbb, const bool punt)
{
/**************************************
*
@ -6515,7 +6516,7 @@ static bool write_page(
/* write out page to main database file, and to any
shadows, making a special case of the header page */
int backup_state = dbb->dbb_backup_manager->get_state();
const int backup_state = dbb->dbb_backup_manager->get_state();
if (bdb->bdb_page.getPageNum() >= 0) {
fb_assert(backup_state != nbak_state_unknown);

View File

@ -36,15 +36,15 @@ bool CCH_exclusive(Jrd::thread_db*, USHORT, SSHORT);
bool CCH_exclusive_attachment(Jrd::thread_db*, USHORT, SSHORT);
void CCH_expand(Jrd::thread_db*, ULONG);
Ods::pag* CCH_fake(Jrd::thread_db*, Jrd::win*, SSHORT);
Ods::pag* CCH_fetch(Jrd::thread_db*, Jrd::win*, USHORT, SCHAR, SSHORT, SSHORT, bool);
Ods::pag* CCH_fetch(Jrd::thread_db*, Jrd::win*, USHORT, SCHAR, SSHORT, SSHORT, const bool);
SSHORT CCH_fetch_lock(Jrd::thread_db*, Jrd::win*, USHORT, SSHORT, SSHORT, SCHAR);
void CCH_fetch_page(Jrd::thread_db*, Jrd::win*, SSHORT, bool);
void CCH_fetch_page(Jrd::thread_db*, Jrd::win*, SSHORT, const bool);
void CCH_forget_page(Jrd::thread_db*, Jrd::win*);
void CCH_fini(Jrd::thread_db*);
void CCH_flush(Jrd::thread_db*, USHORT, SLONG);
bool CCH_free_page(Jrd::thread_db*);
SLONG CCH_get_incarnation(Jrd::win*);
Ods::pag* CCH_handoff(Jrd::thread_db*, Jrd::win*, SLONG, SSHORT, SCHAR, SSHORT, SSHORT);
Ods::pag* CCH_handoff(Jrd::thread_db*, Jrd::win*, SLONG, SSHORT, SCHAR, SSHORT, const bool);
void CCH_init(Jrd::thread_db*, ULONG);
void CCH_mark(Jrd::thread_db*, Jrd::win*, USHORT, USHORT);
void CCH_must_write(Jrd::win*);
@ -55,11 +55,11 @@ void CCH_precedence(Jrd::thread_db*, Jrd::win*, Jrd::PageNumber);
void CCH_prefetch(Jrd::thread_db*, SLONG*, SSHORT);
bool CCH_prefetch_pages(Jrd::thread_db*);
#endif
void CCH_release(Jrd::thread_db*, Jrd::win*, bool);
void CCH_release(Jrd::thread_db*, Jrd::win*, const bool);
void CCH_release_and_free(Jrd::win*);
void CCH_release_exclusive(Jrd::thread_db*);
bool CCH_rollover_to_shadow(Jrd::Database*, Jrd::jrd_file*, const bool);
void CCH_unwind(Jrd::thread_db*, bool);
void CCH_unwind(Jrd::thread_db*, const bool);
bool CCH_validate(Jrd::win*);
void CCH_flush_ast(Jrd::thread_db*);
bool CCH_write_all_shadows(Jrd::thread_db*, Jrd::Shadow*, Jrd::BufferDesc*,
@ -119,17 +119,17 @@ inline void CCH_MARK_SYSTEM(Jrd::thread_db* tdbb, Jrd::win * window)
inline Ods::pag* CCH_HANDOFF(Jrd::thread_db* tdbb, Jrd::win* window, SLONG page, SSHORT lock, SCHAR page_type)
{
return CCH_handoff (tdbb, window, page, lock, page_type, 1, 0);
return CCH_handoff (tdbb, window, page, lock, page_type, 1, false);
}
inline Ods::pag* CCH_HANDOFF_TIMEOUT(Jrd::thread_db* tdbb, Jrd::win* window, SLONG page, SSHORT lock, SCHAR page_type, SSHORT latch_wait)
{
return CCH_handoff (tdbb, window, page, lock, page_type, latch_wait, 0);
return CCH_handoff (tdbb, window, page, lock, page_type, latch_wait, false);
}
inline Ods::pag* CCH_HANDOFF_TAIL(Jrd::thread_db* tdbb, Jrd::win* window, SLONG page, SSHORT lock, SCHAR page_type)
{
return CCH_handoff (tdbb, window, page, lock, page_type, 1, 1);
return CCH_handoff (tdbb, window, page, lock, page_type, 1, true);
}
inline void CCH_MARK_MUST_WRITE(Jrd::thread_db* tdbb, Jrd::win * window)
@ -154,9 +154,9 @@ inline void CCH_PREFETCH(Jrd::thread_db* tdbb, SLONG * pages, SSHORT count)
//#define CCH_RELEASE_TAIL(tdbb, window) CCH_release (tdbb, window, true)
//#define CCH_MARK(tdbb, window) CCH_mark (tdbb, window, 0)
//#define CCH_MARK_SYSTEM(tdbb, window) CCH_mark (tdbb, window, 1)
//#define CCH_HANDOFF(tdbb, window, page, lock, type) CCH_handoff (tdbb, window, page, lock, type, 1, 0)
//#define CCH_HANDOFF_TIMEOUT(tdbb, window, page, lock, type, latch_wait) CCH_handoff (tdbb, window, page, lock, type, latch_wait, 0)
//#define CCH_HANDOFF_TAIL(tdbb, window, page, lock, type) CCH_handoff (tdbb, window, page, lock, type, 1, 1)
//#define CCH_HANDOFF(tdbb, window, page, lock, type) CCH_handoff (tdbb, window, page, lock, type, 1, false)
//#define CCH_HANDOFF_TIMEOUT(tdbb, window, page, lock, type, latch_wait) CCH_handoff (tdbb, window, page, lock, type, latch_wait, false)
//#define CCH_HANDOFF_TAIL(tdbb, window, page, lock, type) CCH_handoff (tdbb, window, page, lock, type, 1, true)
//#define CCH_MARK_MUST_WRITE(tdbb, window) CCH_mark_must_write (tdbb, window)
//#define CCH_PREFETCH(tdbb, pages, count) CCH_prefetch (tdbb, pages, count)