Skip to content

Commit

Permalink
buf_page_io_complete(): Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Mar 10, 2018
1 parent aec4734 commit 1e4cb84
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions storage/innobase/buf/buf0buf.cc
Expand Up @@ -6093,8 +6093,9 @@ buf_page_io_complete(buf_page_t* bpage, bool evict)
}
}

BPageMutex* block_mutex = buf_page_get_mutex(bpage);
buf_pool_mutex_enter(buf_pool);
mutex_enter(buf_page_get_mutex(bpage));
mutex_enter(block_mutex);

#ifdef UNIV_IBUF_COUNT_DEBUG
if (io_type == BUF_IO_WRITE || uncompressed) {
Expand All @@ -6112,8 +6113,7 @@ buf_page_io_complete(buf_page_t* bpage, bool evict)
buf_page_set_io_fix(bpage, BUF_IO_NONE);
buf_page_monitor(bpage, io_type);

switch (io_type) {
case BUF_IO_READ:
if (io_type == BUF_IO_READ) {
/* NOTE that the call to ibuf may have moved the ownership of
the x-latch to this OS thread: do not let this confuse you in
debugging! */
Expand All @@ -6127,11 +6127,8 @@ buf_page_io_complete(buf_page_t* bpage, bool evict)
BUF_IO_READ);
}

mutex_exit(buf_page_get_mutex(bpage));

break;

case BUF_IO_WRITE:
mutex_exit(block_mutex);
} else {
/* Write means a flush operation: call the completion
routine in the flush system */

Expand All @@ -6154,18 +6151,11 @@ buf_page_io_complete(buf_page_t* bpage, bool evict)
evict = true;
}

mutex_exit(block_mutex);

if (evict) {
mutex_exit(buf_page_get_mutex(bpage));
buf_LRU_free_page(bpage, true);
} else {
mutex_exit(buf_page_get_mutex(bpage));
}


break;

default:
ut_error;
}

DBUG_PRINT("ib_buf", ("%s page %u:%u",
Expand Down

0 comments on commit 1e4cb84

Please sign in to comment.