Skip to content
Permalink
Browse files
MDEV-18115: Remove some redundant comparisons
Now that FIL_TYPE_LOG no longer exists, let us remove some redundant
comparisons of fil_space_t::purpose.

fil_flush_low(): Do not distinguish FIL_TYPE_TEMPORARY.

fil_space_get_space(): Assume that space->purpose is valid.
  • Loading branch information
dr-m committed Jan 10, 2020
1 parent 314a14f commit f7da495
Showing 1 changed file with 4 additions and 26 deletions.
@@ -711,15 +711,8 @@ static void fil_flush_low(fil_space_t* space, bool metadata = false)

ut_a(node->is_open());

switch (space->purpose) {
case FIL_TYPE_TEMPORARY:
ut_ad(0); // we already checked for this
/* fall through */
case FIL_TYPE_TABLESPACE:
case FIL_TYPE_IMPORT:
fil_n_pending_tablespace_flushes++;
break;
}
fil_n_pending_tablespace_flushes++;

#ifdef _WIN32
if (node->is_raw_disk) {

@@ -749,16 +742,7 @@ static void fil_flush_low(fil_space_t* space, bool metadata = false)
}
}

switch (space->purpose) {
case FIL_TYPE_TEMPORARY:
break;
case FIL_TYPE_TABLESPACE:
case FIL_TYPE_IMPORT:
fil_n_pending_tablespace_flushes--;
continue;
}

ut_ad(0);
fil_n_pending_tablespace_flushes--;
}

space->n_pending_flushes--;
@@ -1387,13 +1371,7 @@ fil_space_get_space(
return(space);
}

switch (space->purpose) {
case FIL_TYPE_TEMPORARY:
case FIL_TYPE_TABLESPACE:
case FIL_TYPE_IMPORT:
space = fil_system.read_page0(id);
}

space = fil_system.read_page0(id);
return(space);
}

0 comments on commit f7da495

Please sign in to comment.