Commit 6b0531d6 authored by marko's avatar marko

branches/zip: buf_flush_insert_into_flush_list(),

buf_flush_insert_sorted_into_flush_list(): Remove unused code.
Change the parameter to buf_block_t* block and assert that
block->state == BUF_BLOCK_FILE_PAGE.  This is part of Issue #155.
parent 5d091740
2009-01-09 The InnoDB Team
* include/buf0flu.h, include/buf0flu.ic, buf/buf0flu.c:
Remove unused code from the functions
buf_flush_insert_into_flush_list() and
buf_flush_insert_sorted_into_flush_list().
2009-01-09 The InnoDB Team
* buf/buf0flu.c: Simplify the function buf_flush_try_page().
2009-01-07 The InnoDB Team
* row/row0merge.c:
......
......@@ -43,37 +43,20 @@ UNIV_INTERN
void
buf_flush_insert_into_flush_list(
/*=============================*/
buf_page_t* bpage) /* in: block which is modified */
buf_block_t* block) /* in/out: block which is modified */
{
ut_ad(buf_pool_mutex_own());
ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL)
|| (UT_LIST_GET_FIRST(buf_pool->flush_list)->oldest_modification
<= bpage->oldest_modification));
<= block->page.oldest_modification));
switch (buf_page_get_state(bpage)) {
case BUF_BLOCK_ZIP_PAGE:
mutex_enter(&buf_pool_zip_mutex);
buf_page_set_state(bpage, BUF_BLOCK_ZIP_DIRTY);
mutex_exit(&buf_pool_zip_mutex);
UT_LIST_REMOVE(list, buf_pool->zip_clean, bpage);
/* fall through */
case BUF_BLOCK_ZIP_DIRTY:
case BUF_BLOCK_FILE_PAGE:
ut_ad(bpage->in_LRU_list);
ut_ad(bpage->in_page_hash);
ut_ad(!bpage->in_zip_hash);
ut_ad(!bpage->in_flush_list);
ut_d(bpage->in_flush_list = TRUE);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, bpage);
break;
case BUF_BLOCK_ZIP_FREE:
case BUF_BLOCK_NOT_USED:
case BUF_BLOCK_READY_FOR_USE:
case BUF_BLOCK_MEMORY:
case BUF_BLOCK_REMOVE_HASH:
ut_error;
return;
}
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
ut_ad(block->page.in_LRU_list);
ut_ad(block->page.in_page_hash);
ut_ad(!block->page.in_zip_hash);
ut_ad(!block->page.in_flush_list);
ut_d(block->page.in_flush_list = TRUE);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page);
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(buf_flush_validate_low());
......@@ -88,51 +71,34 @@ UNIV_INTERN
void
buf_flush_insert_sorted_into_flush_list(
/*====================================*/
buf_page_t* bpage) /* in: block which is modified */
buf_block_t* block) /* in/out: block which is modified */
{
buf_page_t* prev_b;
buf_page_t* b;
ut_ad(buf_pool_mutex_own());
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
switch (buf_page_get_state(bpage)) {
case BUF_BLOCK_ZIP_PAGE:
mutex_enter(&buf_pool_zip_mutex);
buf_page_set_state(bpage, BUF_BLOCK_ZIP_DIRTY);
mutex_exit(&buf_pool_zip_mutex);
UT_LIST_REMOVE(list, buf_pool->zip_clean, bpage);
/* fall through */
case BUF_BLOCK_ZIP_DIRTY:
case BUF_BLOCK_FILE_PAGE:
ut_ad(bpage->in_LRU_list);
ut_ad(bpage->in_page_hash);
ut_ad(!bpage->in_zip_hash);
ut_ad(!bpage->in_flush_list);
ut_d(bpage->in_flush_list = TRUE);
break;
case BUF_BLOCK_ZIP_FREE:
case BUF_BLOCK_NOT_USED:
case BUF_BLOCK_READY_FOR_USE:
case BUF_BLOCK_MEMORY:
case BUF_BLOCK_REMOVE_HASH:
ut_error;
return;
}
ut_ad(block->page.in_LRU_list);
ut_ad(block->page.in_page_hash);
ut_ad(!block->page.in_zip_hash);
ut_ad(!block->page.in_flush_list);
ut_d(block->page.in_flush_list = TRUE);
prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list);
while (b && b->oldest_modification > bpage->oldest_modification) {
while (b && b->oldest_modification > block->page.oldest_modification) {
ut_ad(b->in_flush_list);
prev_b = b;
b = UT_LIST_GET_NEXT(list, b);
}
if (prev_b == NULL) {
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, bpage);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page);
} else {
UT_LIST_INSERT_AFTER(list, buf_pool->flush_list,
prev_b, bpage);
prev_b, &block->page);
}
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
......
......@@ -14,13 +14,6 @@ Created 11/5/1995 Heikki Tuuri
#include "ut0byte.h"
#include "mtr0types.h"
/************************************************************************
Inserts a modified block into the flush list. */
UNIV_INTERN
void
buf_flush_insert_into_flush_list(
/*=============================*/
buf_page_t* bpage); /* in: block which is modified */
/************************************************************************
Remove a block from the flush list of modified blocks. */
UNIV_INTERN
......
......@@ -9,6 +9,13 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0buf.h"
#include "mtr0mtr.h"
/************************************************************************
Inserts a modified block into the flush list. */
UNIV_INTERN
void
buf_flush_insert_into_flush_list(
/*=============================*/
buf_block_t* block); /* in/out: block which is modified */
/************************************************************************
Inserts a modified block into the flush list in the right sorted position.
This function is used by recovery, because there the modifications do not
......@@ -17,7 +24,7 @@ UNIV_INTERN
void
buf_flush_insert_sorted_into_flush_list(
/*====================================*/
buf_page_t* bpage); /* in: block which is modified */
buf_block_t* block); /* in/out: block which is modified */
/************************************************************************
This function should be called at a mini-transaction commit, if a page was
......@@ -49,7 +56,7 @@ buf_flush_note_modification(
block->page.oldest_modification = mtr->start_lsn;
ut_ad(block->page.oldest_modification != 0);
buf_flush_insert_into_flush_list(&block->page);
buf_flush_insert_into_flush_list(block);
} else {
ut_ad(block->page.oldest_modification <= mtr->start_lsn);
}
......@@ -88,7 +95,7 @@ buf_flush_recv_note_modification(
ut_ad(block->page.oldest_modification != 0);
buf_flush_insert_sorted_into_flush_list(&block->page);
buf_flush_insert_sorted_into_flush_list(block);
} else {
ut_ad(block->page.oldest_modification <= start_lsn);
}
......
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