Commit 483a5708 authored by marko's avatar marko

branches/zip: buf_page_get_release_on_io(), buf_page_get_gen():

Replace buf_frame_t* guess with buf_block_t* guess in order to avoid
a buf_block_align() call.

trx_undo_t: Replace page_t* guess_page with buf_block_t* guess_block.

btr_search_t: Replace page_t* root_guess with buf_block_t* root_guess.
parent 22015f39
......@@ -304,7 +304,7 @@ btr_cur_search_to_nth_level(
{
page_cur_t* page_cursor;
page_t* page;
page_t* guess;
buf_block_t* guess;
rec_t* node_ptr;
ulint page_no;
ulint space;
......@@ -512,8 +512,8 @@ btr_cur_search_to_nth_level(
root_height = height;
cursor->tree_height = root_height + 1;
#ifdef BTR_CUR_ADAPT
if (page != guess) {
info->root_guess = page;
if (block != guess) {
info->root_guess = block;
}
#endif
}
......
......@@ -1164,7 +1164,7 @@ buf_page_get_gen(
ulint space, /* in: space id */
ulint offset, /* in: page number */
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
buf_frame_t* guess, /* in: guessed frame or NULL */
buf_block_t* guess, /* in: guessed block or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH, BUF_GET_NOWAIT */
const char* file, /* in: file name */
......@@ -1195,7 +1195,7 @@ buf_page_get_gen(
block = NULL;
if (guess) {
block = buf_block_align(guess);
block = guess;
if ((offset != block->offset) || (space != block->space)
|| (block->state != BUF_BLOCK_FILE_PAGE)) {
......
......@@ -146,7 +146,7 @@ struct btr_search_struct{
/* The following fields are not protected by any latch.
Unfortunately, this means that they must be aligned to
the machine word, i.e., they cannot be turned into bit-fields. */
page_t* root_guess; /* the root page frame when it was last time
buf_block_t* root_guess;/* the root page frame when it was last time
fetched, or NULL */
ulint hash_analysis; /* when this exceeds BTR_SEARCH_HASH_ANALYSIS,
the hash analysis starts; this is reset if no
......
......@@ -194,7 +194,7 @@ buf_page_get_release_on_io(
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
buf_frame_t* guess, /* in: guessed frame or NULL */
buf_block_t* guess, /* in: guessed frame or NULL */
ulint rw_latch, /* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint savepoint, /* in: mtr savepoint */
......@@ -223,7 +223,7 @@ buf_page_get_gen(
ulint space, /* in: space id */
ulint offset, /* in: page number */
ulint rw_latch,/* in: RW_S_LATCH, RW_X_LATCH, RW_NO_LATCH */
buf_frame_t* guess, /* in: guessed frame or NULL */
buf_block_t* guess, /* in: guessed block or NULL */
ulint mode, /* in: BUF_GET, BUF_GET_IF_IN_POOL,
BUF_GET_NO_LATCH */
const char* file, /* in: file name */
......
......@@ -548,7 +548,7 @@ buf_page_get_release_on_io(
ulint space, /* in: space id */
ulint offset, /* in: offset of the page within space
in units of a page */
buf_frame_t* guess, /* in: guessed frame or NULL */
buf_block_t* guess, /* in: guessed block or NULL */
ulint rw_latch, /* in: RW_X_LATCH, RW_S_LATCH,
or RW_NO_LATCH */
ulint savepoint, /* in: mtr savepoint */
......
......@@ -374,7 +374,7 @@ struct trx_undo_struct{
i.e., the topmost element in the undo
log if we think of it as a stack */
dulint top_undo_no; /* undo number of the latest record */
page_t* guess_page; /* guess for the buffer frame where
buf_block_t* guess_block; /* guess for the buffer block where
the top page might reside */
/*-----------------------------*/
UT_LIST_NODE_T(trx_undo_t) undo_list;
......
......@@ -1028,6 +1028,7 @@ trx_undo_report_row_operation(
{
trx_t* trx;
trx_undo_t* undo;
buf_block_t* undo_block;
page_t* undo_page;
ulint offset;
ulint page_no;
......@@ -1093,16 +1094,13 @@ trx_undo_report_row_operation(
mtr_start(&mtr);
for (;;) {
buf_block_t* block = buf_page_get_gen(undo->space, page_no,
RW_X_LATCH,
undo->guess_page,
BUF_GET,
__FILE__, __LINE__,
&mtr);
undo_block = buf_page_get_gen(undo->space, page_no, RW_X_LATCH,
undo->guess_block, BUF_GET,
__FILE__, __LINE__, &mtr);
#ifdef UNIV_SYNC_DEBUG
buf_block_dbg_add_level(block, SYNC_TRX_UNDO_PAGE);
buf_block_dbg_add_level(undo_block, SYNC_TRX_UNDO_PAGE);
#endif /* UNIV_SYNC_DEBUG */
undo_page = buf_block_get_frame(block);
undo_page = buf_block_get_frame(undo_block);
if (op_type == TRX_UNDO_INSERT_OP) {
offset = trx_undo_page_report_insert(
......@@ -1163,7 +1161,7 @@ trx_undo_report_row_operation(
undo->top_page_no = page_no;
undo->top_offset = offset;
undo->top_undo_no = trx->undo_no;
undo->guess_page = undo_page;
undo->guess_block = undo_block;
UT_DULINT_INC(trx->undo_no);
......
......@@ -1422,7 +1422,7 @@ trx_undo_mem_create(
undo->empty = TRUE;
undo->top_page_no = page_no;
undo->guess_page = NULL;
undo->guess_block = NULL;
return(undo);
}
......
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