Commit d04c4b39 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-14304 Unnecessary conditions in buf_page_get_gen()

Ever since MDEV-10813 cleaned up InnoDB use of atomic memory operations
and made buf_block_fix() an atomic operation, some conditions around
buf_block_fix() have been unnecessary.
parent fff7fc50
......@@ -4263,24 +4263,7 @@ buf_page_get_gen(
sure that no state change takes place. */
fix_block = block;
if (fsp_is_system_temporary(page_id.space())) {
/* For temporary tablespace,
the mutex is being used for
synchronization between user
thread and flush thread,
instead of block->lock. See
buf_flush_page() for the flush
thread counterpart. */
BPageMutex* fix_mutex
= buf_page_get_mutex(
&fix_block->page);
mutex_enter(fix_mutex);
buf_block_fix(fix_block);
mutex_exit(fix_mutex);
} else {
buf_block_fix(fix_block);
}
buf_block_fix(fix_block);
/* Now safe to release page_hash mutex */
rw_lock_x_unlock(hash_lock);
......@@ -4371,19 +4354,7 @@ buf_page_get_gen(
fix_block = block;
}
if (fsp_is_system_temporary(page_id.space())) {
/* For temporary tablespace, the mutex is being used
for synchronization between user thread and flush
thread, instead of block->lock. See buf_flush_page()
for the flush thread counterpart. */
BPageMutex* fix_mutex = buf_page_get_mutex(
&fix_block->page);
mutex_enter(fix_mutex);
buf_block_fix(fix_block);
mutex_exit(fix_mutex);
} else {
buf_block_fix(fix_block);
}
buf_block_fix(fix_block);
/* Now safe to release page_hash mutex */
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