Commit 51d0b629 authored by marko's avatar marko

branches/zip: buf_page_peek(): Return TRUE also if the page exists in the

buffer pool in compressed form only.

buf_page_peek_block(): Remove.

mutex_enter_fast_func: Remove.
parent e2db2a87
......@@ -1346,37 +1346,6 @@ buf_page_make_young(
mutex_exit(&(buf_pool->mutex));
}
/************************************************************************
Returns the buffer control block if the page can be found in the buffer
pool. NOTE that it is possible that the page is not yet read
from disk, though. This is a very low-level function: use with care! */
buf_block_t*
buf_page_peek_block(
/*================*/
/* out: control block if found from page hash table,
otherwise NULL; NOTE that the page is not necessarily
yet read from disk! */
ulint space, /* in: space id */
ulint offset) /* in: page number */
{
buf_block_t* block;
mutex_enter_fast(&(buf_pool->mutex));
block = (buf_block_t*) buf_page_hash_get(space, offset);
mutex_exit(&(buf_pool->mutex));
if (block
&& UNIV_UNLIKELY(buf_block_get_state(block)
!= BUF_BLOCK_FILE_PAGE)) {
block = NULL;
}
return(block);
}
/************************************************************************
Resets the check_index_page_at_flush field of a page if found in the buffer
pool. */
......
......@@ -298,19 +298,6 @@ buf_page_peek(
ulint space, /* in: space id */
ulint offset);/* in: page number */
/************************************************************************
Returns the buffer control block if the page can be found in the buffer
pool. NOTE that it is possible that the page is not yet read
from disk, though. This is a very low-level function: use with care! */
buf_block_t*
buf_page_peek_block(
/*================*/
/* out: control block if found from page hash table,
otherwise NULL; NOTE that the page is not necessarily
yet read from disk! */
ulint space, /* in: space id */
ulint offset);/* in: page number */
/************************************************************************
Resets the check_index_page_at_flush field of a page if found in the buffer
pool. */
......
......@@ -11,22 +11,6 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0rea.h"
#include "mtr0mtr.h"
/************************************************************************
Returns TRUE if the page can be found in the buffer pool hash table. NOTE
that it is possible that the page is not yet read from disk, though. */
UNIV_INLINE
ibool
buf_page_peek(
/*==========*/
/* out: TRUE if found from page hash table,
NOTE that the page is not necessarily yet read
from disk! */
ulint space, /* in: space id */
ulint offset) /* in: page number */
{
return(buf_page_peek_block(space, offset) != NULL);
}
/************************************************************************
Reads the freed_page_clock of a buffer block. */
UNIV_INLINE
......@@ -907,6 +891,30 @@ buf_page_hash_get(
return(bpage);
}
/************************************************************************
Returns TRUE if the page can be found in the buffer pool hash table. NOTE
that it is possible that the page is not yet read from disk, though. */
UNIV_INLINE
ibool
buf_page_peek(
/*==========*/
/* out: TRUE if found from page hash table,
NOTE that the page is not necessarily yet read
from disk! */
ulint space, /* in: space id */
ulint offset) /* in: page number */
{
const buf_page_t* bpage;
mutex_enter(&buf_pool->mutex);
bpage = buf_page_hash_get(space, offset);
mutex_exit(&buf_pool->mutex);
return(bpage != NULL);
}
/************************************************************************
Tries to get the page, but if file io is required, releases all latches
in mtr down to the given savepoint. If io is required, this function
......
......@@ -101,7 +101,6 @@ corresponding function. */
/* NOTE! currently same as mutex_enter! */
#define mutex_enter_fast(M) mutex_enter_func((M), __FILE__, __LINE__)
#define mutex_enter_fast_func mutex_enter_func;
/**********************************************************************
NOTE! Use the corresponding macro in the header file, not this function
directly. Locks a mutex for the current thread. If the mutex is reserved
......
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