Skip to content
Permalink
Browse files
buf_page_get_zip(): Deduplicate some code
  • Loading branch information
dr-m committed Feb 23, 2019
1 parent 2c8d9a4 commit 15a2036
Showing 1 changed file with 3 additions and 11 deletions.
@@ -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);

0 comments on commit 15a2036

Please sign in to comment.