Skip to content

Commit d04c4b3

Browse files
committed
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.
1 parent fff7fc5 commit d04c4b3

File tree

1 file changed

+2
-31
lines changed

1 file changed

+2
-31
lines changed

storage/innobase/buf/buf0buf.cc

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4263,24 +4263,7 @@ buf_page_get_gen(
42634263
sure that no state change takes place. */
42644264
fix_block = block;
42654265

4266-
if (fsp_is_system_temporary(page_id.space())) {
4267-
/* For temporary tablespace,
4268-
the mutex is being used for
4269-
synchronization between user
4270-
thread and flush thread,
4271-
instead of block->lock. See
4272-
buf_flush_page() for the flush
4273-
thread counterpart. */
4274-
4275-
BPageMutex* fix_mutex
4276-
= buf_page_get_mutex(
4277-
&fix_block->page);
4278-
mutex_enter(fix_mutex);
4279-
buf_block_fix(fix_block);
4280-
mutex_exit(fix_mutex);
4281-
} else {
4282-
buf_block_fix(fix_block);
4283-
}
4266+
buf_block_fix(fix_block);
42844267

42854268
/* Now safe to release page_hash mutex */
42864269
rw_lock_x_unlock(hash_lock);
@@ -4371,19 +4354,7 @@ buf_page_get_gen(
43714354
fix_block = block;
43724355
}
43734356

4374-
if (fsp_is_system_temporary(page_id.space())) {
4375-
/* For temporary tablespace, the mutex is being used
4376-
for synchronization between user thread and flush
4377-
thread, instead of block->lock. See buf_flush_page()
4378-
for the flush thread counterpart. */
4379-
BPageMutex* fix_mutex = buf_page_get_mutex(
4380-
&fix_block->page);
4381-
mutex_enter(fix_mutex);
4382-
buf_block_fix(fix_block);
4383-
mutex_exit(fix_mutex);
4384-
} else {
4385-
buf_block_fix(fix_block);
4386-
}
4357+
buf_block_fix(fix_block);
43874358

43884359
/* Now safe to release page_hash mutex */
43894360
rw_lock_s_unlock(hash_lock);

0 commit comments

Comments
 (0)