Commit 17e10898 authored by marko's avatar marko

branches/zip: Make buf_block_buf_fix_inc() a macro wrapper for

buf_block_buf_fix_inc_func() to eliminate an #ifdef in every invocation.
parent 267a81eb
......@@ -1441,11 +1441,7 @@ loop:
}
}
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
buf_block_buf_fix_inc(block, file, line);
mutex_exit(&buf_pool->mutex);
/* Check if this is the first access to the page */
......@@ -1576,11 +1572,7 @@ buf_page_optimistic_get_func(
return(FALSE);
}
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
buf_block_buf_fix_inc(block, file, line);
accessed = block->accessed;
block->accessed = TRUE;
......@@ -1708,11 +1700,8 @@ buf_page_get_known_nowait(
ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, file, line);
#else
buf_block_buf_fix_inc(block);
#endif
buf_block_buf_fix_inc(block, file, line);
mutex_exit(&block->mutex);
if (mode == BUF_MAKE_YOUNG) {
......@@ -2057,11 +2046,7 @@ buf_page_create(
/* The block must be put to the LRU list */
buf_LRU_add_block(block, FALSE);
#ifdef UNIV_SYNC_DEBUG
buf_block_buf_fix_inc_debug(block, __FILE__, __LINE__);
#else
buf_block_buf_fix_inc(block);
#endif
buf_block_buf_fix_inc(block, __FILE__, __LINE__);
buf_pool->n_pages_created++;
mutex_exit(&(buf_pool->mutex));
......
......@@ -541,36 +541,33 @@ buf_block_get_modify_clock(
return(block->modify_clock);
}
#ifdef UNIV_SYNC_DEBUG
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
void
buf_block_buf_fix_inc_debug(
/*========================*/
buf_block_t* block, /* in: block to bufferfix */
buf_block_buf_fix_inc_func(
/*=======================*/
#ifdef UNIV_SYNC_DEBUG
const char* file, /* in: file name */
ulint line) /* in: line */
ulint line, /* in: line */
#endif /* UNIV_SYNC_DEBUG */
buf_block_t* block) /* in: block to bufferfix */
{
#ifdef UNIV_SYNC_DEBUG
ibool ret;
ret = rw_lock_s_lock_func_nowait(&(block->debug_latch), file, line);
ut_a(ret);
ut_a(mutex_own(&block->mutex));
#endif /* UNIV_SYNC_DEBUG */
block->buf_fix_count++;
}
#ifdef UNIV_SYNC_DEBUG
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(f,l,b)
#else /* UNIV_SYNC_DEBUG */
/***********************************************************************
Increments the bufferfix count. */
UNIV_INLINE
void
buf_block_buf_fix_inc(
/*==================*/
buf_block_t* block) /* in: block to bufferfix */
{
block->buf_fix_count++;
}
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b)
#endif /* UNIV_SYNC_DEBUG */
/**********************************************************************
Returns the control block of a file page, NULL if not found. */
UNIV_INLINE
......
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