Commit 1838b003 authored by marko's avatar marko

branches/innodb+: Non-functional change: Rename all functions related to the

buf_pool->watch_ fields to start with the common prefix buf_pool_watch,
so that they can be searched easily:

buf_pool_watch_set(): Renamed from buf_pool_add_watch().  The "add" was
misleading, because only one watch can be active at a time.

buf_pool_watch_clear(): Renamed from buf_pool_remove_watch().

buf_pool_watch_occurred(): Renamed from buf_pool_watch_happened().
parent 0f852ae1
......@@ -1385,7 +1385,7 @@ Add watch for the given page to be read in. Caller must have the buffer pool
mutex reserved. */
static
void
buf_pool_add_watch(
buf_pool_watch_set(
/*===============*/
ulint space, /* in: space id */
ulint page_no) /* in: page number */
......@@ -1397,7 +1397,7 @@ buf_pool_add_watch(
buf_pool->watch_active = TRUE;
buf_pool->watch_space = space;
buf_pool->watch_happened = FALSE;
buf_pool->watch_occurred = FALSE;
buf_pool->watch_page_no = page_no;
}
......@@ -1405,8 +1405,8 @@ buf_pool_add_watch(
Stop watching if the marked page is read in. */
UNIV_INTERN
void
buf_pool_remove_watch(void)
/*=======================*/
buf_pool_watch_clear(void)
/*======================*/
{
buf_pool_mutex_enter();
......@@ -1422,7 +1422,7 @@ Check if the given page is being watched and has been read to the buffer
pool. */
UNIV_INTERN
ibool
buf_pool_watch_happened(
buf_pool_watch_occurred(
/*====================*/
/* out: TRUE if the given page is being
watched and it has been read in */
......@@ -1436,7 +1436,7 @@ buf_pool_watch_happened(
ret = buf_pool->watch_active
&& space == buf_pool->watch_space
&& page_no == buf_pool->watch_page_no
&& buf_pool->watch_happened;
&& buf_pool->watch_occurred;
buf_pool_mutex_exit();
......@@ -1921,7 +1921,7 @@ buf_page_get_gen(
/* Page not in buf_pool: needs to be read from file */
if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) {
buf_pool_add_watch(space, offset);
buf_pool_watch_set(space, offset);
}
buf_pool_mutex_exit();
......@@ -1953,7 +1953,7 @@ buf_page_get_gen(
complete. */
if (mode == BUF_GET_IF_IN_POOL_OR_WATCH) {
buf_pool_add_watch(space, offset);
buf_pool_watch_set(space, offset);
}
/* The page is only being read to buffer */
......@@ -2517,7 +2517,7 @@ buf_page_init_low(
Set watch happened flag. */
UNIV_INLINE
void
buf_page_notify_watch(
buf_pool_watch_notify(
/*==================*/
ulint space, /* in: space id of page read in */
ulint offset) /* in: offset of page read in */
......@@ -2528,7 +2528,7 @@ buf_page_notify_watch(
&& space == buf_pool->watch_space
&& offset == buf_pool->watch_page_no) {
buf_pool->watch_happened = TRUE;
buf_pool->watch_occurred = TRUE;
}
}
......@@ -2621,7 +2621,7 @@ buf_page_init(
}
buf_page_init_low(&block->page);
buf_page_notify_watch(space, offset);
buf_pool_watch_notify(space, offset);
ut_ad(!block->page.in_zip_hash);
ut_ad(!block->page.in_page_hash);
......@@ -2727,7 +2727,7 @@ buf_page_init_for_read(
mutex_enter(&block->mutex);
buf_page_init(space, offset, block);
buf_page_notify_watch(space, offset);
buf_pool_watch_notify(space, offset);
/* The block must be put to the LRU list, to the old blocks */
buf_LRU_add_block(bpage, TRUE/* to old blocks */);
......@@ -2804,7 +2804,7 @@ buf_page_init_for_read(
page_zip_get_size(&bpage->zip), bpage);
buf_page_init_low(bpage);
buf_page_notify_watch(space, offset);
buf_pool_watch_notify(space, offset);
bpage->state = BUF_BLOCK_ZIP_PAGE;
bpage->space = space;
......@@ -2904,7 +2904,7 @@ buf_page_create(
mutex_enter(&block->mutex);
buf_page_init(space, offset, block);
buf_page_notify_watch(space, offset);
buf_pool_watch_notify(space, offset);
/* The block must be put to the LRU list */
buf_LRU_add_block(&block->page, FALSE);
......
......@@ -3031,7 +3031,7 @@ ibuf_insert_low(
/* Don't buffer deletes if the page has been read in to the buffer
pool. */
if (op == IBUF_OP_DELETE && buf_pool_watch_happened(space, page_no)) {
if (op == IBUF_OP_DELETE && buf_pool_watch_occurred(space, page_no)) {
err = DB_STRONG_FAIL;
goto function_exit;
......
......@@ -976,16 +976,16 @@ buf_get_free_list_len(void);
/*=======================*/
/********************************************************************
Stop watching if the marked page is read in. */
UNIV_INTERN
void
buf_pool_remove_watch(void);
/*=======================*/
buf_pool_watch_clear(void);
/*======================*/
/********************************************************************
Check if the given page is being watched and has been read to the buffer
pool. */
UNIV_INTERN
ibool
buf_pool_watch_happened(
buf_pool_watch_occurred(
/*====================*/
/* out: TRUE if the given page is being
watched and it has been read in */
......@@ -1234,12 +1234,12 @@ struct buf_pool_struct{
buf_page_in_file() == TRUE,
indexed by (space_id, offset) */
/*--------------------------*/ /* Delete buffering data */
ibool watch_active; /* if TRUE, set watch_happened to
TRUE when page watch_space/
watch_page_no is read in. */
ibool watch_active; /* if TRUE, set watch_occurred
when watch_space, watch_page_no
is read in. */
ulint watch_space; /* space id of watched page */
ulint watch_page_no; /* page number of watched page */
ibool watch_happened; /* has watched page been read in */
ibool watch_occurred; /* has watched page been read in */
/*--------------------------*/
......
......@@ -361,7 +361,7 @@ row_purge_remove_sec_if_poss_low(
if (success && old_has) {
/* Can't remove the index record yet. */
buf_pool_remove_watch();
buf_pool_watch_clear();
return(TRUE);
}
......@@ -377,7 +377,7 @@ row_purge_remove_sec_if_poss_low(
btr_pcur_close(&pcur);
mtr_commit(&mtr);
buf_pool_remove_watch();
buf_pool_watch_clear();
if (!was_buffered) {
/* Page read into buffer pool or delete-buffering failed. */
......
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