Commit 68d632bc authored by Marko Mäkelä's avatar Marko Mäkelä

Replace some functions with macros.

This is a non-functional change.

On a related note, the calls fil_system_enter() and fil_system_exit()
are often used in an unsafe manner. The fix of MDEV-11738 should
introduce fil_space_acquire() and remove potential race conditions.
parent adc91387
...@@ -7146,27 +7146,6 @@ fil_mtr_rename_log( ...@@ -7146,27 +7146,6 @@ fil_mtr_rename_log(
return(err); return(err);
} }
/****************************************************************//**
Acquire fil_system mutex */
void
fil_system_enter(void)
/*==================*/
{
ut_ad(!mutex_own(&fil_system->mutex));
mutex_enter(&fil_system->mutex);
}
/****************************************************************//**
Release fil_system mutex */
void
fil_system_exit(void)
/*=================*/
{
ut_ad(mutex_own(&fil_system->mutex));
mutex_exit(&fil_system->mutex);
}
/****************************************************************** /******************************************************************
Get id of first tablespace or ULINT_UNDEFINED if none */ Get id of first tablespace or ULINT_UNDEFINED if none */
UNIV_INTERN UNIV_INTERN
......
...@@ -1290,16 +1290,10 @@ fil_space_get( ...@@ -1290,16 +1290,10 @@ fil_space_get(
ulint id); /*!< in: space id */ ulint id); /*!< in: space id */
#endif /* !UNIV_INNOCHECKSUM */ #endif /* !UNIV_INNOCHECKSUM */
/****************************************************************//** /** Acquire the fil_system mutex. */
Acquire fil_system mutex */ #define fil_system_enter() mutex_enter(&fil_system->mutex)
void /** Release the fil_system mutex. */
fil_system_enter(void); #define fil_system_exit() mutex_exit(&fil_system->mutex)
/*==================*/
/****************************************************************//**
Release fil_system mutex */
void
fil_system_exit(void);
/*==================*/
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
/*******************************************************************//** /*******************************************************************//**
......
...@@ -7260,27 +7260,6 @@ fil_space_set_corrupt( ...@@ -7260,27 +7260,6 @@ fil_space_set_corrupt(
mutex_exit(&fil_system->mutex); mutex_exit(&fil_system->mutex);
} }
/****************************************************************//**
Acquire fil_system mutex */
void
fil_system_enter(void)
/*==================*/
{
ut_ad(!mutex_own(&fil_system->mutex));
mutex_enter(&fil_system->mutex);
}
/****************************************************************//**
Release fil_system mutex */
void
fil_system_exit(void)
/*=================*/
{
ut_ad(mutex_own(&fil_system->mutex));
mutex_exit(&fil_system->mutex);
}
/****************************************************************** /******************************************************************
Get id of first tablespace or ULINT_UNDEFINED if none */ Get id of first tablespace or ULINT_UNDEFINED if none */
UNIV_INTERN UNIV_INTERN
......
...@@ -1314,16 +1314,10 @@ fil_space_set_corrupt( ...@@ -1314,16 +1314,10 @@ fil_space_set_corrupt(
/*==================*/ /*==================*/
ulint space_id); ulint space_id);
/****************************************************************//** /** Acquire the fil_system mutex. */
Acquire fil_system mutex */ #define fil_system_enter() mutex_enter(&fil_system->mutex)
void /** Release the fil_system mutex. */
fil_system_enter(void); #define fil_system_exit() mutex_exit(&fil_system->mutex)
/*==================*/
/****************************************************************//**
Release fil_system mutex */
void
fil_system_exit(void);
/*==================*/
#ifndef UNIV_INNOCHECKSUM #ifndef UNIV_INNOCHECKSUM
/*******************************************************************//** /*******************************************************************//**
......
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