mirror of
https://github.com/MariaDB/server.git
synced 2025-12-13 20:03:16 +03:00
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)).
This commit is contained in:
@@ -738,7 +738,7 @@ ibool
|
|||||||
buf_page_can_relocate(
|
buf_page_can_relocate(
|
||||||
/*==================*/
|
/*==================*/
|
||||||
const buf_page_t* bpage) /* control block being relocated */
|
const buf_page_t* bpage) /* control block being relocated */
|
||||||
__attribute__((const));
|
__attribute__((pure));
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Determine if a block has been flagged old. */
|
Determine if a block has been flagged old. */
|
||||||
@@ -774,6 +774,16 @@ buf_page_set_accessed(
|
|||||||
/*==================*/
|
/*==================*/
|
||||||
buf_page_t* bpage, /* in/out: control block */
|
buf_page_t* bpage, /* in/out: control block */
|
||||||
ibool accessed); /* in: accessed */
|
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
|
#ifdef UNIV_DEBUG
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Gets a pointer to the memory frame of a block. */
|
Gets a pointer to the memory frame of a block. */
|
||||||
|
|||||||
@@ -460,6 +460,26 @@ buf_page_set_accessed(
|
|||||||
bpage->accessed = 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
|
#ifdef UNIV_DEBUG
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Gets a pointer to the memory frame of a block. */
|
Gets a pointer to the memory frame of a block. */
|
||||||
|
|||||||
Reference in New Issue
Block a user