Commit 20d7ea98 authored by marko's avatar marko

branches/zip: Add the function buf_page_get_block(), for converting

from buf_page_t* to buf_block_t*.

buf_page_can_relocate(): Replace the incorrect __attribute__((const))
with __attribute__((pure)).
parent 3b99f0d1
......@@ -738,7 +738,7 @@ ibool
buf_page_can_relocate(
/*==================*/
const buf_page_t* bpage) /* control block being relocated */
__attribute__((const));
__attribute__((pure));
/*************************************************************************
Determine if a block has been flagged old. */
......@@ -774,6 +774,16 @@ buf_page_set_accessed(
/*==================*/
buf_page_t* bpage, /* in/out: control block */
ibool accessed); /* in: accessed */
/*************************************************************************
Gets the buf_block_t handle of a buffered file block if an uncompressed
page frame exists, or NULL. */
UNIV_INLINE
const buf_block_t*
buf_page_get_block(
/*===============*/
/* out: control block, or NULL */
const buf_page_t* bpage) /* in: control block */
__attribute__((pure));
#ifdef UNIV_DEBUG
/*************************************************************************
Gets a pointer to the memory frame of a block. */
......
......@@ -460,6 +460,26 @@ buf_page_set_accessed(
bpage->accessed = accessed;
}
/*************************************************************************
Gets the buf_block_t handle of a buffered file block if an uncompressed
page frame exists, or NULL. */
UNIV_INLINE
const buf_block_t*
buf_page_get_block(
/*===============*/
/* out: control block, or NULL */
const buf_page_t* bpage) /* in: control block */
{
ut_ad(buf_page_in_file(bpage));
ut_ad(mutex_own(buf_page_get_mutex((buf_page_t*) bpage)));
if (buf_page_get_state(bpage) == BUF_BLOCK_FILE_PAGE) {
return((const buf_block_t*) bpage);
}
return(NULL);
}
#ifdef UNIV_DEBUG
/*************************************************************************
Gets a pointer to the memory frame of a block. */
......
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