Commit bae70109 authored by marko's avatar marko

branches/zip: buf_page_t: Rename free_or_flush_list to list

and document the possible list memberships.
parent db53c1eb
......@@ -693,8 +693,7 @@ buf_chunk_init(
memset(block->frame, '\0', UNIV_PAGE_SIZE);
#endif
/* Add the block to the free list */
UT_LIST_ADD_LAST(free_or_flush_list, buf_pool->free,
(&block->page));
UT_LIST_ADD_LAST(list, buf_pool->free, (&block->page));
ut_d(block->page.in_free_list = TRUE);
block++;
......@@ -794,8 +793,7 @@ buf_chunk_free(
ut_ad(!block->page.in_LRU_list);
/* Remove the block from the free list. */
ut_ad(block->page.in_free_list);
UT_LIST_REMOVE(free_or_flush_list, buf_pool->free,
(&block->page));
UT_LIST_REMOVE(list, buf_pool->free, (&block->page));
/* Free the latches. */
mutex_free(&block->mutex);
......
......@@ -61,7 +61,7 @@ buf_flush_insert_into_flush_list(
|| (UT_LIST_GET_FIRST(buf_pool->flush_list)->oldest_modification
<= bpage->oldest_modification));
UT_LIST_ADD_FIRST(free_or_flush_list, buf_pool->flush_list, bpage);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, bpage);
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
ut_a(buf_flush_validate_low());
......@@ -90,15 +90,14 @@ buf_flush_insert_sorted_into_flush_list(
while (b && b->oldest_modification > bpage->oldest_modification) {
prev_b = b;
b = UT_LIST_GET_NEXT(free_or_flush_list, b);
b = UT_LIST_GET_NEXT(list, b);
}
if (prev_b == NULL) {
UT_LIST_ADD_FIRST(free_or_flush_list,
buf_pool->flush_list, bpage);
UT_LIST_ADD_FIRST(list, buf_pool->flush_list, bpage);
} else {
UT_LIST_INSERT_AFTER(free_or_flush_list,
buf_pool->flush_list, prev_b, bpage);
UT_LIST_INSERT_AFTER(list, buf_pool->flush_list,
prev_b, bpage);
}
#if defined UNIV_DEBUG || defined UNIV_BUF_DEBUG
......@@ -195,10 +194,9 @@ buf_flush_write_complete(
bpage->oldest_modification = 0;
UT_LIST_REMOVE(free_or_flush_list, buf_pool->flush_list, bpage);
UT_LIST_REMOVE(list, buf_pool->flush_list, bpage);
ut_d(UT_LIST_VALIDATE(free_or_flush_list, buf_page_t,
buf_pool->flush_list));
ut_d(UT_LIST_VALIDATE(list, buf_page_t, buf_pool->flush_list));
flush_type = buf_page_get_flush_type(bpage);
buf_pool->n_flush[flush_type]--;
......@@ -1000,8 +998,7 @@ buf_flush_batch(
mutex_exit(block_mutex);
bpage = UT_LIST_GET_PREV(free_or_flush_list,
bpage);
bpage = UT_LIST_GET_PREV(list, bpage);
}
}
......@@ -1148,7 +1145,7 @@ buf_flush_validate_low(void)
buf_page_t* bpage;
ib_uint64_t om;
UT_LIST_VALIDATE(free_or_flush_list, buf_page_t, buf_pool->flush_list);
UT_LIST_VALIDATE(list, buf_page_t, buf_pool->flush_list);
bpage = UT_LIST_GET_FIRST(buf_pool->flush_list);
......@@ -1157,7 +1154,7 @@ buf_flush_validate_low(void)
ut_a(buf_page_in_file(bpage));
ut_a(om > 0);
bpage = UT_LIST_GET_NEXT(free_or_flush_list, bpage);
bpage = UT_LIST_GET_NEXT(list, bpage);
if (bpage) {
ut_a(om >= bpage->oldest_modification);
......
......@@ -138,8 +138,7 @@ buf_LRU_invalidate_tablespace(
blocks */
bpage->oldest_modification = 0;
UT_LIST_REMOVE(free_or_flush_list,
buf_pool->flush_list,
UT_LIST_REMOVE(list, buf_pool->flush_list,
bpage);
}
......@@ -464,8 +463,7 @@ buf_LRU_get_free_block(
ut_d(block->page.in_free_list = FALSE);
ut_ad(!block->page.in_LRU_list);
ut_a(!buf_page_in_file(&block->page));
UT_LIST_REMOVE(free_or_flush_list, buf_pool->free,
(&block->page));
UT_LIST_REMOVE(list, buf_pool->free, (&block->page));
if (buf_block_get_zip_size(block) != zip_size) {
page_zip_set_size(&block->page.zip, zip_size);
......@@ -917,7 +915,7 @@ buf_LRU_block_free_non_file_page(
page_zip_set_size(&block->page.zip, 0);
}
UT_LIST_ADD_FIRST(free_or_flush_list, buf_pool->free, (&block->page));
UT_LIST_ADD_FIRST(list, buf_pool->free, (&block->page));
ut_d(block->page.in_free_list = TRUE);
UNIV_MEM_INVALID(block->frame, UNIV_PAGE_SIZE);
......@@ -1086,11 +1084,11 @@ buf_LRU_validate(void)
ut_a(buf_pool->LRU_old_len == old_len);
}
UT_LIST_VALIDATE(free_or_flush_list, buf_page_t, buf_pool->free);
UT_LIST_VALIDATE(list, buf_page_t, buf_pool->free);
for (bpage = UT_LIST_GET_FIRST(buf_pool->free);
bpage != NULL;
bpage = UT_LIST_GET_NEXT(free_or_flush_list, bpage)) {
bpage = UT_LIST_GET_NEXT(list, bpage)) {
ut_a(buf_page_get_state(bpage) == BUF_BLOCK_NOT_USED);
}
......
......@@ -920,12 +920,16 @@ struct buf_page_struct{
/* 2. Page flushing fields; protected by buf_pool->mutex */
UT_LIST_NODE_T(buf_page_t) free_or_flush_list;
/* if buf_page_in_file(), this is a
node of the modified, not yet
flushed blocks list;
if state == BUF_BLOCK_NOT_USED,
this is a node of the "free" list */
UT_LIST_NODE_T(buf_page_t) list;
/* based on state, this is a list
node in one of the following lists
in buf_pool:
BUF_BLOCK_NOT_USED: free
BUF_BLOCK_FILE_PAGE: flush_list
BUF_BLOCK_ZIP_DIRTY: flush_list
BUF_BLOCK_ZIP_PAGE: zip_clean
BUF_BLOCK_ZIP_FREE: zip_free[] */
#ifdef UNIV_DEBUG
ibool in_free_list; /* TRUE if in the free list; used in
debugging */
......
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