diff options
Diffstat (limited to 'storage/innobase/include/buf0buf.ic')
-rw-r--r-- | storage/innobase/include/buf0buf.ic | 63 |
1 files changed, 7 insertions, 56 deletions
diff --git a/storage/innobase/include/buf0buf.ic b/storage/innobase/include/buf0buf.ic index 7ca08449c8c..2169eedd015 100644 --- a/storage/innobase/include/buf0buf.ic +++ b/storage/innobase/include/buf0buf.ic @@ -35,9 +35,7 @@ Created 11/5/1995 Heikki Tuuri #include "buf0flu.h" #include "buf0lru.h" #include "buf0rea.h" -#include "sync0debug.h" #include "fsp0types.h" -#include "ut0new.h" /** A chunk of buffers. The buffer pool is allocated in chunks. */ struct buf_chunk_t{ @@ -947,28 +945,6 @@ buf_block_get_modify_clock( return(block->modify_clock); } -/** Increments the bufferfix count. -@param[in,out] bpage block to bufferfix -@return the count */ -UNIV_INLINE -ulint -buf_block_fix( - buf_page_t* bpage) -{ - return uint32(my_atomic_add32((int32*) &bpage->buf_fix_count, 1) + 1); -} - -/** Increments the bufferfix count. -@param[in,out] block block to bufferfix -@return the count */ -UNIV_INLINE -ulint -buf_block_fix( - buf_block_t* block) -{ - return(buf_block_fix(&block->page)); -} - /*******************************************************************//** Increments the bufferfix count. */ UNIV_INLINE @@ -987,37 +963,12 @@ buf_block_buf_fix_inc_func( threaded. */ if (!fsp_is_system_temporary(block->page.id.space())) { ibool ret; - ret = rw_lock_s_lock_nowait(&block->debug_latch, file, line); + ret = rw_lock_s_lock_nowait(block->debug_latch, file, line); ut_a(ret); } #endif /* UNIV_DEBUG */ - buf_block_fix(block); -} - -/** Decrements the bufferfix count. -@param[in,out] bpage block to bufferunfix -@return the remaining buffer-fix count */ -UNIV_INLINE -ulint -buf_block_unfix( - buf_page_t* bpage) -{ - uint32 count = uint32(my_atomic_add32((int32*) &bpage->buf_fix_count, - -1)); - ut_ad(count != 0); - return count - 1; -} - -/** Decrements the bufferfix count. -@param[in,out] block block to bufferunfix -@return the remaining buffer-fix count */ -UNIV_INLINE -ulint -buf_block_unfix( - buf_block_t* block) -{ - return(buf_block_unfix(&block->page)); + block->fix(); } /*******************************************************************//** @@ -1028,14 +979,14 @@ buf_block_buf_fix_dec( /*==================*/ buf_block_t* block) /*!< in/out: block to bufferunfix */ { - buf_block_unfix(block); + block->unfix(); #ifdef UNIV_DEBUG /* No debug latch is acquired if block belongs to system temporary. Debug latch is not of much help if access to block is single threaded. */ if (!fsp_is_system_temporary(block->page.id.space())) { - rw_lock_s_unlock(&block->debug_latch); + rw_lock_s_unlock(block->debug_latch); } #endif /* UNIV_DEBUG */ } @@ -1278,14 +1229,14 @@ buf_page_release_zip( is single threaded. */ buf_block_t* block = reinterpret_cast<buf_block_t*>(bpage); if (!fsp_is_system_temporary(block->page.id.space())) { - rw_lock_s_unlock(&block->debug_latch); + rw_lock_s_unlock(block->debug_latch); } } #endif /* UNIV_DEBUG */ /* Fall through */ case BUF_BLOCK_ZIP_PAGE: case BUF_BLOCK_ZIP_DIRTY: - buf_block_unfix(reinterpret_cast<buf_block_t*>(bpage)); + reinterpret_cast<buf_block_t*>(bpage)->unfix(); return; case BUF_BLOCK_POOL_WATCH: @@ -1314,7 +1265,7 @@ buf_page_release_latch( temporary. Debug latch is not of much help if access to block is single threaded. */ if (!fsp_is_system_temporary(block->page.id.space())) { - rw_lock_s_unlock(&block->debug_latch); + rw_lock_s_unlock(block->debug_latch); } #endif /* UNIV_DEBUG */ |