Commit 932c00c3 authored by marko's avatar marko

branches/zip: log_reserve_and_write_fast(): Do not cache the log_sys pointer

in a local variable.
parent 92e8d1b2
......@@ -311,44 +311,45 @@ log_reserve_and_write_fast(
ulint len, /*!< in: string length */
ib_uint64_t* start_lsn)/*!< out: start lsn of the log record */
{
log_t* log = log_sys;
ulint data_len;
ib_uint64_t lsn;
mutex_enter(&(log->mutex));
mutex_enter(&log_sys->mutex);
data_len = len + log->buf_free % OS_FILE_LOG_BLOCK_SIZE;
data_len = len + log_sys->buf_free % OS_FILE_LOG_BLOCK_SIZE;
if (data_len >= OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE) {
/* The string does not fit within the current log block
or the log block would become full */
mutex_exit(&(log->mutex));
mutex_exit(&log_sys->mutex);
return(0);
}
*start_lsn = log->lsn;
*start_lsn = log_sys->lsn;
ut_memcpy(log->buf + log->buf_free, str, len);
ut_memcpy(log_sys->buf + log_sys->buf_free, str, len);
log_block_set_data_len((byte*) ut_align_down(log->buf + log->buf_free,
log_block_set_data_len((byte*) ut_align_down(log_sys->buf
+ log_sys->buf_free,
OS_FILE_LOG_BLOCK_SIZE),
data_len);
#ifdef UNIV_LOG_DEBUG
log->old_buf_free = log->buf_free;
log->old_lsn = log->lsn;
log_sys->old_buf_free = log_sys->buf_free;
log_sys->old_lsn = log_sys->lsn;
#endif
log->buf_free += len;
log_sys->buf_free += len;
ut_ad(log->buf_free <= log->buf_size);
ut_ad(log_sys->buf_free <= log_sys->buf_size);
lsn = log->lsn += len;
lsn = log_sys->lsn += len;
#ifdef UNIV_LOG_DEBUG
log_check_log_recs(log->buf + log->old_buf_free,
log->buf_free - log->old_buf_free, log->old_lsn);
log_check_log_recs(log_sys->buf + log_sys->old_buf_free,
log_sys->buf_free - log_sys->old_buf_free,
log_sys->old_lsn);
#endif
return(lsn);
}
......
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