Commit 7c94b19f authored by marko's avatar marko

branches/zip: Minor cleanup.

buf_page_get_gen(): Cache the result of fil_space_get_zip_size().

trx_commit_off_kernel(): Eliminate the flag must_flush_log.  Initialize lsn = 0
to signify must_flush_log == FALSE.

log_flush_margin(): Eliminate the flag do_flush.  Initialize lsn = 0
to signify do_flush == FALSE.
parent a9f0595a
......@@ -1484,6 +1484,7 @@ buf_page_get_gen(
ulint fix_type;
ibool success;
ibool must_read;
const ulint zip_size = fil_space_get_zip_size(space);
ut_ad(mtr);
ut_ad((rw_latch == RW_S_LATCH)
......@@ -1493,8 +1494,7 @@ buf_page_get_gen(
ut_ad((mode == BUF_GET) || (mode == BUF_GET_IF_IN_POOL)
|| (mode == BUF_GET_NO_LATCH) || (mode == BUF_GET_NOWAIT));
#ifndef UNIV_LOG_DEBUG
ut_ad(!ibuf_inside()
|| ibuf_page(space, fil_space_get_zip_size(space), offset));
ut_ad(!ibuf_inside() || ibuf_page(space, zip_size, offset));
#endif
buf_pool->n_page_gets++;
loop:
......@@ -1527,7 +1527,7 @@ buf_page_get_gen(
return(NULL);
}
buf_read_page(space, fil_space_get_zip_size(space), offset);
buf_read_page(space, zip_size, offset);
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(++buf_dbg_counter % 37 || buf_validate());
......@@ -1636,8 +1636,7 @@ buf_page_get_gen(
/* In the case of a first access, try to apply linear
read-ahead */
buf_read_ahead_linear(space, buf_block_get_zip_size(block),
offset);
buf_read_ahead_linear(space, zip_size, offset);
}
#ifdef UNIV_IBUF_DEBUG
......
......@@ -1536,9 +1536,8 @@ void
log_flush_margin(void)
/*==================*/
{
ibool do_flush = FALSE;
log_t* log = log_sys;
ib_uint64_t lsn;
ib_uint64_t lsn = 0;
mutex_enter(&(log->mutex));
......@@ -1548,14 +1547,13 @@ log_flush_margin(void)
/* A flush is running: hope that it will provide enough
free space */
} else {
do_flush = TRUE;
lsn = log->lsn;
}
}
mutex_exit(&(log->mutex));
if (do_flush) {
if (lsn) {
log_write_up_to(lsn, LOG_NO_WAIT, FALSE);
}
}
......
......@@ -743,10 +743,9 @@ trx_commit_off_kernel(
trx_t* trx) /* in: transaction */
{
page_t* update_hdr_page;
ib_uint64_t lsn;
ib_uint64_t lsn = 0;
trx_rseg_t* rseg;
trx_undo_t* undo;
ibool must_flush_log = FALSE;
mtr_t mtr;
#ifdef UNIV_SYNC_DEBUG
......@@ -763,8 +762,6 @@ trx_commit_off_kernel(
mtr_start(&mtr);
must_flush_log = TRUE;
/* Change the undo log segment states from TRX_UNDO_ACTIVE
to some other state: these modifications to the file data
structure define the transaction as committed in the file
......@@ -883,7 +880,7 @@ trx_commit_off_kernel(
trx->read_view = NULL;
if (must_flush_log) {
if (lsn) {
mutex_exit(&kernel_mutex);
......
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