summaryrefslogtreecommitdiff
path: root/storage/xtradb/include/buf0buf.ic
diff options
context:
space:
mode:
Diffstat (limited to 'storage/xtradb/include/buf0buf.ic')
-rw-r--r--storage/xtradb/include/buf0buf.ic42
1 files changed, 34 insertions, 8 deletions
diff --git a/storage/xtradb/include/buf0buf.ic b/storage/xtradb/include/buf0buf.ic
index 221f86d9d62..8d5c3edeef8 100644
--- a/storage/xtradb/include/buf0buf.ic
+++ b/storage/xtradb/include/buf0buf.ic
@@ -434,7 +434,7 @@ buf_block_set_file_page(
}
/*********************************************************************//**
-Gets the io_fix state of a block.
+Gets the io_fix state of a block. Requires that the block mutex is held.
@return io_fix state */
UNIV_INLINE
enum buf_io_fix
@@ -442,6 +442,20 @@ buf_page_get_io_fix(
/*================*/
const buf_page_t* bpage) /*!< in: pointer to the control block */
{
+ ut_ad(mutex_own(buf_page_get_mutex(bpage)));
+ return buf_page_get_io_fix_unlocked(bpage);
+}
+
+/*********************************************************************//**
+Gets the io_fix state of a block. Does not assert that the block mutex is
+held, to be used in the cases where it is safe not to hold it.
+@return io_fix state */
+UNIV_INLINE
+enum buf_io_fix
+buf_page_get_io_fix_unlocked(
+/*=========================*/
+ const buf_page_t* bpage) /*!< in: pointer to the control block */
+{
enum buf_io_fix io_fix = (enum buf_io_fix) bpage->io_fix;
#ifdef UNIV_DEBUG
switch (io_fix) {
@@ -457,7 +471,7 @@ buf_page_get_io_fix(
}
/*********************************************************************//**
-Gets the io_fix state of a block.
+Gets the io_fix state of a block. Requires that the block mutex is held.
@return io_fix state */
UNIV_INLINE
enum buf_io_fix
@@ -469,6 +483,19 @@ buf_block_get_io_fix(
}
/*********************************************************************//**
+Gets the io_fix state of a block. Does not assert that the block mutex is
+held, to be used in the cases where it is safe not to hold it.
+@return io_fix state */
+UNIV_INLINE
+enum buf_io_fix
+buf_block_get_io_fix_unlocked(
+/*==========================*/
+ const buf_block_t* block) /*!< in: pointer to the control block */
+{
+ return(buf_page_get_io_fix_unlocked(&block->page));
+}
+
+/*********************************************************************//**
Sets the io_fix state of a block. */
UNIV_INLINE
void
@@ -638,19 +665,18 @@ UNIV_INLINE
void
buf_page_set_accessed(
/*==================*/
- buf_page_t* bpage, /*!< in/out: control block */
- ulint time_ms) /*!< in: ut_time_ms() */
+ buf_page_t* bpage) /*!< in/out: control block */
{
#ifdef UNIV_DEBUG
- //buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
- //ut_ad(buf_pool_mutex_own(buf_pool));
-#endif
+ buf_pool_t* buf_pool = buf_pool_from_bpage(bpage);
+ ut_ad(!buf_pool_mutex_own(buf_pool));
ut_ad(mutex_own(buf_page_get_mutex(bpage)));
+#endif
ut_a(buf_page_in_file(bpage));
if (!bpage->access_time) {
/* Make this the time of the first access. */
- bpage->access_time = time_ms;
+ bpage->access_time = ut_time_ms();
}
}