Commit aafdd9ab authored by marko's avatar marko

branches/zip: Introduce the function buf_block_fix_dec(), similar to

buf_block_fix_inc(), and use it.
parent 331af5c5
...@@ -1937,13 +1937,8 @@ buf_page_get_gen( ...@@ -1937,13 +1937,8 @@ buf_page_get_gen(
if (!success) { if (!success) {
mutex_enter(&block->mutex); mutex_enter(&block->mutex);
buf_block_buf_fix_dec(block);
block->page.buf_fix_count--;
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
#endif
return(NULL); return(NULL);
} }
...@@ -2056,14 +2051,9 @@ buf_page_optimistic_get_func( ...@@ -2056,14 +2051,9 @@ buf_page_optimistic_get_func(
if (UNIV_UNLIKELY(!success)) { if (UNIV_UNLIKELY(!success)) {
mutex_enter(&block->mutex); mutex_enter(&block->mutex);
buf_block_buf_fix_dec(block);
block->page.buf_fix_count--;
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
#endif
return(FALSE); return(FALSE);
} }
...@@ -2078,14 +2068,9 @@ buf_page_optimistic_get_func( ...@@ -2078,14 +2068,9 @@ buf_page_optimistic_get_func(
} }
mutex_enter(&block->mutex); mutex_enter(&block->mutex);
buf_block_buf_fix_dec(block);
block->page.buf_fix_count--;
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
#endif
return(FALSE); return(FALSE);
} }
...@@ -2179,15 +2164,9 @@ buf_page_get_known_nowait( ...@@ -2179,15 +2164,9 @@ buf_page_get_known_nowait(
if (!success) { if (!success) {
mutex_enter(&block->mutex); mutex_enter(&block->mutex);
buf_block_buf_fix_dec(block);
block->page.buf_fix_count--;
mutex_exit(&block->mutex); mutex_exit(&block->mutex);
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&(block->debug_latch));
#endif
return(FALSE); return(FALSE);
} }
......
...@@ -874,6 +874,22 @@ buf_block_buf_fix_inc_func( ...@@ -874,6 +874,22 @@ buf_block_buf_fix_inc_func(
# define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b) # define buf_block_buf_fix_inc(b,f,l) buf_block_buf_fix_inc_func(b)
#endif /* UNIV_SYNC_DEBUG */ #endif /* UNIV_SYNC_DEBUG */
/***********************************************************************
Decrements the bufferfix count. */
UNIV_INLINE
void
buf_block_buf_fix_dec(
/*==================*/
buf_block_t* block) /* in: block to bufferunfix */
{
ut_ad(mutex_own(&block->mutex));
block->page.buf_fix_count--;
#ifdef UNIV_SYNC_DEBUG
rw_lock_s_unlock(&block->debug_latch);
#endif
}
/********************************************************************** /**********************************************************************
Returns the control block of a file page, NULL if not found. */ Returns the control block of a file page, NULL if not found. */
UNIV_INLINE 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