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 2009-01-07 The InnoDB Team
* row/row0merge.c: * row/row0merge.c:
......
...@@ -43,37 +43,20 @@ UNIV_INTERN ...@@ -43,37 +43,20 @@ UNIV_INTERN
void void
buf_flush_insert_into_flush_list( 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(buf_pool_mutex_own());
ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL) ut_ad((UT_LIST_GET_FIRST(buf_pool->flush_list) == NULL)
|| (UT_LIST_GET_FIRST(buf_pool->flush_list)->oldest_modification || (UT_LIST_GET_FIRST(buf_pool->flush_list)->oldest_modification
<= bpage->oldest_modification)); <= block->page.oldest_modification));
switch (buf_page_get_state(bpage)) { ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
case BUF_BLOCK_ZIP_PAGE: ut_ad(block->page.in_LRU_list);
mutex_enter(&buf_pool_zip_mutex); ut_ad(block->page.in_page_hash);
buf_page_set_state(bpage, BUF_BLOCK_ZIP_DIRTY); ut_ad(!block->page.in_zip_hash);
mutex_exit(&buf_pool_zip_mutex); ut_ad(!block->page.in_flush_list);
UT_LIST_REMOVE(list, buf_pool->zip_clean, bpage); ut_d(block->page.in_flush_list = TRUE);
/* fall through */ UT_LIST_ADD_FIRST(list, buf_pool->flush_list, &block->page);
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;
}
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(buf_flush_validate_low()); ut_a(buf_flush_validate_low());
...@@ -88,51 +71,34 @@ UNIV_INTERN ...@@ -88,51 +71,34 @@ UNIV_INTERN
void void
buf_flush_insert_sorted_into_flush_list( 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* prev_b;
buf_page_t* b; buf_page_t* b;
ut_ad(buf_pool_mutex_own()); ut_ad(buf_pool_mutex_own());
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
switch (buf_page_get_state(bpage)) { ut_ad(block->page.in_LRU_list);
case BUF_BLOCK_ZIP_PAGE: ut_ad(block->page.in_page_hash);
mutex_enter(&buf_pool_zip_mutex); ut_ad(!block->page.in_zip_hash);
buf_page_set_state(bpage, BUF_BLOCK_ZIP_DIRTY); ut_ad(!block->page.in_flush_list);
mutex_exit(&buf_pool_zip_mutex); ut_d(block->page.in_flush_list = TRUE);
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;
}
prev_b = NULL; prev_b = NULL;
b = UT_LIST_GET_FIRST(buf_pool->flush_list); 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); ut_ad(b->in_flush_list);
prev_b = b; prev_b = b;
b = UT_LIST_GET_NEXT(list, b); b = UT_LIST_GET_NEXT(list, b);
} }
if (prev_b == NULL) { 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 { } else {
UT_LIST_INSERT_AFTER(list, buf_pool->flush_list, UT_LIST_INSERT_AFTER(list, buf_pool->flush_list,
prev_b, bpage); prev_b, &block->page);
} }
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG #if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
......
...@@ -14,13 +14,6 @@ Created 11/5/1995 Heikki Tuuri ...@@ -14,13 +14,6 @@ Created 11/5/1995 Heikki Tuuri
#include "ut0byte.h" #include "ut0byte.h"
#include "mtr0types.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. */ Remove a block from the flush list of modified blocks. */
UNIV_INTERN UNIV_INTERN
......
...@@ -9,6 +9,13 @@ Created 11/5/1995 Heikki Tuuri ...@@ -9,6 +9,13 @@ Created 11/5/1995 Heikki Tuuri
#include "buf0buf.h" #include "buf0buf.h"
#include "mtr0mtr.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. 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 This function is used by recovery, because there the modifications do not
...@@ -17,7 +24,7 @@ UNIV_INTERN ...@@ -17,7 +24,7 @@ UNIV_INTERN
void void
buf_flush_insert_sorted_into_flush_list( 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 This function should be called at a mini-transaction commit, if a page was
...@@ -49,7 +56,7 @@ buf_flush_note_modification( ...@@ -49,7 +56,7 @@ buf_flush_note_modification(
block->page.oldest_modification = mtr->start_lsn; block->page.oldest_modification = mtr->start_lsn;
ut_ad(block->page.oldest_modification != 0); ut_ad(block->page.oldest_modification != 0);
buf_flush_insert_into_flush_list(&block->page); buf_flush_insert_into_flush_list(block);
} else { } else {
ut_ad(block->page.oldest_modification <= mtr->start_lsn); ut_ad(block->page.oldest_modification <= mtr->start_lsn);
} }
...@@ -88,7 +95,7 @@ buf_flush_recv_note_modification( ...@@ -88,7 +95,7 @@ buf_flush_recv_note_modification(
ut_ad(block->page.oldest_modification != 0); 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 { } else {
ut_ad(block->page.oldest_modification <= start_lsn); 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