Skip to content

Commit 15a2036

Browse files
committed
buf_page_get_zip(): Deduplicate some code
1 parent 2c8d9a4 commit 15a2036

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3782,18 +3782,10 @@ buf_page_get_zip(
37823782
ut_ad(!buf_pool_watch_is_sentinel(buf_pool, bpage));
37833783

37843784
switch (buf_page_get_state(bpage)) {
3785-
case BUF_BLOCK_POOL_WATCH:
3786-
case BUF_BLOCK_NOT_USED:
3787-
case BUF_BLOCK_READY_FOR_USE:
3788-
case BUF_BLOCK_MEMORY:
3789-
case BUF_BLOCK_REMOVE_HASH:
3790-
ut_error;
3791-
37923785
case BUF_BLOCK_ZIP_PAGE:
37933786
case BUF_BLOCK_ZIP_DIRTY:
37943787
buf_block_fix(bpage);
37953788
block_mutex = &buf_pool->zip_mutex;
3796-
mutex_enter(block_mutex);
37973789
goto got_block;
37983790
case BUF_BLOCK_FILE_PAGE:
37993791
/* Discard the uncompressed page frame if possible. */
@@ -3808,16 +3800,16 @@ buf_page_get_zip(
38083800
__FILE__, __LINE__);
38093801

38103802
block_mutex = &((buf_block_t*) bpage)->mutex;
3811-
3812-
mutex_enter(block_mutex);
3813-
38143803
goto got_block;
3804+
default:
3805+
break;
38153806
}
38163807

38173808
ut_error;
38183809
goto err_exit;
38193810

38203811
got_block:
3812+
mutex_enter(block_mutex);
38213813
must_read = buf_page_get_io_fix(bpage) == BUF_IO_READ;
38223814

38233815
rw_lock_s_unlock(hash_lock);

0 commit comments

Comments
 (0)