Skip to content

Commit 68d632b

Browse files
committed
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.
1 parent adc9138 commit 68d632b

File tree

4 files changed

+8
-62
lines changed

4 files changed

+8
-62
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7146,27 +7146,6 @@ fil_mtr_rename_log(
71467146
return(err);
71477147
}
71487148

7149-
/****************************************************************//**
7150-
Acquire fil_system mutex */
7151-
void
7152-
fil_system_enter(void)
7153-
/*==================*/
7154-
{
7155-
ut_ad(!mutex_own(&fil_system->mutex));
7156-
mutex_enter(&fil_system->mutex);
7157-
}
7158-
7159-
/****************************************************************//**
7160-
Release fil_system mutex */
7161-
void
7162-
fil_system_exit(void)
7163-
/*=================*/
7164-
{
7165-
ut_ad(mutex_own(&fil_system->mutex));
7166-
mutex_exit(&fil_system->mutex);
7167-
}
7168-
7169-
71707149
/******************************************************************
71717150
Get id of first tablespace or ULINT_UNDEFINED if none */
71727151
UNIV_INTERN

storage/innobase/include/fil0fil.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,16 +1290,10 @@ fil_space_get(
12901290
ulint id); /*!< in: space id */
12911291
#endif /* !UNIV_INNOCHECKSUM */
12921292

1293-
/****************************************************************//**
1294-
Acquire fil_system mutex */
1295-
void
1296-
fil_system_enter(void);
1297-
/*==================*/
1298-
/****************************************************************//**
1299-
Release fil_system mutex */
1300-
void
1301-
fil_system_exit(void);
1302-
/*==================*/
1293+
/** Acquire the fil_system mutex. */
1294+
#define fil_system_enter() mutex_enter(&fil_system->mutex)
1295+
/** Release the fil_system mutex. */
1296+
#define fil_system_exit() mutex_exit(&fil_system->mutex)
13031297

13041298
#ifndef UNIV_INNOCHECKSUM
13051299
/*******************************************************************//**

storage/xtradb/fil/fil0fil.cc

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7260,27 +7260,6 @@ fil_space_set_corrupt(
72607260
mutex_exit(&fil_system->mutex);
72617261
}
72627262

7263-
/****************************************************************//**
7264-
Acquire fil_system mutex */
7265-
void
7266-
fil_system_enter(void)
7267-
/*==================*/
7268-
{
7269-
ut_ad(!mutex_own(&fil_system->mutex));
7270-
mutex_enter(&fil_system->mutex);
7271-
}
7272-
7273-
/****************************************************************//**
7274-
Release fil_system mutex */
7275-
void
7276-
fil_system_exit(void)
7277-
/*=================*/
7278-
{
7279-
ut_ad(mutex_own(&fil_system->mutex));
7280-
mutex_exit(&fil_system->mutex);
7281-
}
7282-
7283-
72847263
/******************************************************************
72857264
Get id of first tablespace or ULINT_UNDEFINED if none */
72867265
UNIV_INTERN

storage/xtradb/include/fil0fil.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,16 +1314,10 @@ fil_space_set_corrupt(
13141314
/*==================*/
13151315
ulint space_id);
13161316

1317-
/****************************************************************//**
1318-
Acquire fil_system mutex */
1319-
void
1320-
fil_system_enter(void);
1321-
/*==================*/
1322-
/****************************************************************//**
1323-
Release fil_system mutex */
1324-
void
1325-
fil_system_exit(void);
1326-
/*==================*/
1317+
/** Acquire the fil_system mutex. */
1318+
#define fil_system_enter() mutex_enter(&fil_system->mutex)
1319+
/** Release the fil_system mutex. */
1320+
#define fil_system_exit() mutex_exit(&fil_system->mutex)
13271321

13281322
#ifndef UNIV_INNOCHECKSUM
13291323
/*******************************************************************//**

0 commit comments

Comments
 (0)