mirror of
https://github.com/MariaDB/server.git
synced 2025-01-21 06:22:28 +01: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:
parent
3b99f0d17c
commit
20d7ea9851
2 changed files with 31 additions and 1 deletions
|
@ -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. */
|
||||
|
|
Loading…
Reference in a new issue