Commit cb530ba3 authored by marko's avatar marko

branches/zip: Make use of the previously unused state BUF_BLOCK_MEMORY.

buf_LRU_get_free_block(): Document that the block is in the state
BUF_BLOCK_READY_FOR_USE.

buf_block_alloc(): Change the state of the block to BUF_BLOCK_MEMORY
and document it.

Replace those invocations of buf_block_alloc() with
buf_LRU_get_free_block() where the allocated block is used for buffer
pool input and output.  However, temporary copies of B-tree pages
during reorganization are not used for file I/O, and such blocks are
still allocated with buf_block_alloc().
parent 310b625e
......@@ -95,7 +95,7 @@ buf_buddy_block_register(
#ifdef UNIV_SYNC_DEBUG
ut_a(mutex_own(&buf_pool->mutex));
#endif /* UNIV_SYNC_DEBUG */
ut_a(buf_block_get_state(block) == BUF_BLOCK_MEMORY);
buf_block_set_state(block, BUF_BLOCK_MEMORY);
ut_a(block->frame);
ut_a(block->frame == ut_align_down(block->frame, UNIV_PAGE_SIZE));
......
......@@ -1923,7 +1923,7 @@ buf_page_init_for_read(
ut_ad(mode == BUF_READ_ANY_PAGE);
}
block = buf_block_alloc(zip_size);
block = buf_LRU_get_free_block(zip_size);
ut_a(block);
......
......@@ -423,7 +423,8 @@ LRU list to the free list. */
buf_block_t*
buf_LRU_get_free_block(
/*===================*/
/* out: the free control block */
/* out: the free control block,
in state BUF_BLOCK_READY_FOR_USE */
ulint zip_size) /* in: compressed page size in bytes,
or 0 if uncompressed tablespace */
{
......
......@@ -114,7 +114,8 @@ UNIV_INLINE
buf_block_t*
buf_block_alloc(
/*============*/
/* out, own: the allocated block */
/* out, own: the allocated block,
in state BUF_BLOCK_MEMORY */
ulint zip_size); /* in: compressed page size in bytes,
or 0 if uncompressed tablespace */
/************************************************************************
......
......@@ -656,7 +656,8 @@ UNIV_INLINE
buf_block_t*
buf_block_alloc(
/*============*/
/* out, own: the allocated block */
/* out, own: the allocated block,
in state BUF_BLOCK_MEMORY */
ulint zip_size) /* in: compressed page size in bytes,
or 0 if uncompressed tablespace */
{
......@@ -664,6 +665,8 @@ buf_block_alloc(
block = buf_LRU_get_free_block(zip_size);
buf_block_set_state(block, BUF_BLOCK_MEMORY);
return(block);
}
......
......@@ -104,7 +104,8 @@ LRU list to the free list. */
buf_block_t*
buf_LRU_get_free_block(
/*===================*/
/* out: the free control block */
/* out: the free control block,
in state BUF_BLOCK_READY_FOR_USE */
ulint zip_size); /* in: compressed page size in bytes,
or 0 if uncompressed tablespace */
......
......@@ -1564,7 +1564,7 @@ recv_apply_log_recs_for_backup(void)
recv_sys->apply_log_recs = TRUE;
recv_sys->apply_batch_on = TRUE;
block = buf_block_alloc(UNIV_PAGE_SIZE);
block = buf_LRU_get_free_block(UNIV_PAGE_SIZE);
fputs("InnoDB: Starting an apply batch of log records"
" to the database...\n"
......
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