Commit 94ca1bb1 authored by marko's avatar marko

branches/zip: recv_recover_page(): Remove compile-time constant parameters.

parent 6b52f8ca
2009-03-20 The InnoDB Team
* buf/buf0buf.c, include/log0recv.h, log/log0recv.c:
Remove the compile-time constant parameters of recv_recover_page().
2009-03-20 The InnoDB Team
* data/data0type.c, handler/ha_innodb.cc, include/ha_prototypes.h:
......
......@@ -3177,7 +3177,7 @@ buf_page_io_complete(
if (recv_recovery_is_on()) {
/* Pages must be uncompressed for crash recovery. */
ut_a(uncompressed);
recv_recover_page(FALSE, TRUE, (buf_block_t*) bpage);
recv_recover_page(TRUE, (buf_block_t*) bpage);
}
if (uncompressed && !recv_no_ibuf_operations) {
......
......@@ -89,17 +89,19 @@ lsn of a log record. This can be called when a buffer page has just been
read in, or also for a page already in the buffer pool. */
UNIV_INTERN
void
recv_recover_page(
/*==============*/
ibool recover_backup,
/* in: TRUE if we are recovering a backup
page: then we do not acquire any latches
since the page was read in outside the
buffer pool */
recv_recover_page_func(
/*===================*/
#ifndef UNIV_HOTBACKUP
ibool just_read_in,
/* in: TRUE if the i/o-handler calls this for
a freshly read page */
#endif /* !UNIV_HOTBACKUP */
buf_block_t* block); /* in: buffer block */
#ifndef UNIV_HOTBACKUP
# define recv_recover_page(jri, block) recv_recover_page_func(jri, block)
#else /* !UNIV_HOTBACKUP */
# define recv_recover_page(jri, block) recv_recover_page_func(block)
#endif /* !UNIV_HOTBACKUP */
/************************************************************
Recovers from a checkpoint. When this function returns, the database is able
to start processing of new user transactions, but the function
......
......@@ -1186,16 +1186,13 @@ lsn of a log record. This can be called when a buffer page has just been
read in, or also for a page already in the buffer pool. */
UNIV_INTERN
void
recv_recover_page(
/*==============*/
ibool recover_backup,
/* in: TRUE if we are recovering a backup
page: then we do not acquire any latches
since the page was read in outside the
buffer pool */
recv_recover_page_func(
/*===================*/
#ifndef UNIV_HOTBACKUP
ibool just_read_in,
/* in: TRUE if the i/o-handler calls this for
a freshly read page */
#endif /* !UNIV_HOTBACKUP */
buf_block_t* block) /* in: buffer block */
{
page_t* page;
......@@ -1207,7 +1204,9 @@ recv_recover_page(
ib_uint64_t page_lsn;
ib_uint64_t page_newest_lsn;
ibool modification_to_page;
#ifndef UNIV_HOTBACKUP
ibool success;
#endif /* !UNIV_HOTBACKUP */
mtr_t mtr;
mutex_enter(&(recv_sys->mutex));
......@@ -1247,15 +1246,14 @@ recv_recover_page(
page = block->frame;
if (!recover_backup) {
#ifndef UNIV_HOTBACKUP
if (just_read_in) {
/* Move the ownership of the x-latch on the
page to this OS thread, so that we can acquire
a second x-latch on it. This is needed for the
operations to the page to pass the debug
checks. */
/* Move the ownership of the x-latch on the page to
this OS thread, so that we can acquire a second
x-latch on it. This is needed for the operations to
the page to pass the debug checks. */
rw_lock_x_lock_move_ownership(&(block->lock));
rw_lock_x_lock_move_ownership(&block->lock);
}
success = buf_page_get_known_nowait(RW_X_LATCH, block,
......@@ -1265,28 +1263,25 @@ recv_recover_page(
ut_a(success);
buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
}
#endif /* !UNIV_HOTBACKUP */
/* Read the newest modification lsn from the page */
page_lsn = mach_read_ull(page + FIL_PAGE_LSN);
if (!recover_backup) {
#ifndef UNIV_HOTBACKUP
/* It may be that the page has been modified in the buffer
pool: read the newest modification lsn there */
page_newest_lsn
= buf_page_get_newest_modification(&block->page);
page_newest_lsn = buf_page_get_newest_modification(&block->page);
if (page_newest_lsn) {
page_lsn = page_newest_lsn;
}
} else {
/* In recovery from a backup we do not really use the buffer
pool */
#else /* !UNIV_HOTBACKUP */
/* In recovery from a backup we do not really use the buffer pool */
page_newest_lsn = 0;
}
#endif /* !UNIV_HOTBACKUP */
modification_to_page = FALSE;
start_lsn = end_lsn = 0;
......@@ -1375,11 +1370,13 @@ recv_recover_page(
mutex_exit(&(recv_sys->mutex));
if (!recover_backup && modification_to_page) {
#ifndef UNIV_HOTBACKUP
if (modification_to_page) {
ut_a(block);
buf_flush_recv_note_modification(block, start_lsn, end_lsn);
}
#endif /* !UNIV_HOTBACKUP */
/* Make sure that committing mtr does not change the modification
lsn values of page */
......@@ -1513,7 +1510,7 @@ recv_apply_hashed_log_recs(
buf_block_dbg_add_level(
block, SYNC_NO_ORDER_CHECK);
recv_recover_page(FALSE, FALSE, block);
recv_recover_page(FALSE, block);
mtr_commit(&mtr);
} else {
recv_read_in_area(space, zip_size,
......@@ -1693,7 +1690,7 @@ recv_apply_log_recs_for_backup(void)
}
/* Apply the log records to this page */
recv_recover_page(TRUE, FALSE, block);
recv_recover_page(FALSE, block);
/* Write the page back to the tablespace file using the
fil0fil.c routines */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment