Commit 15a20367 authored by Marko Mäkelä's avatar Marko Mäkelä

buf_page_get_zip(): Deduplicate some code

parent 2c8d9a4e
......@@ -3782,18 +3782,10 @@ buf_page_get_zip(
ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
switch (buf_page_get_state(bpage)) {
case BUF_BLOCK_POOL_WATCH:
case BUF_BLOCK_NOT_USED:
case BUF_BLOCK_READY_FOR_USE:
case BUF_BLOCK_MEMORY:
case BUF_BLOCK_REMOVE_HASH:
ut_error;
case BUF_BLOCK_ZIP_PAGE:
case BUF_BLOCK_ZIP_DIRTY:
buf_block_fix(bpage);
block_mutex = &buf_pool->zip_mutex;
mutex_enter(block_mutex);
goto got_block;
case BUF_BLOCK_FILE_PAGE:
/* Discard the uncompressed page frame if possible. */
......@@ -3808,16 +3800,16 @@ buf_page_get_zip(
__FILE__, __LINE__);
block_mutex = &((buf_block_t*) bpage)->mutex;
mutex_enter(block_mutex);
goto got_block;
default:
break;
}
ut_error;
goto err_exit;
got_block:
mutex_enter(block_mutex);
must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ;
rw_lock_s_unlock(hash_lock);
......
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