Skip to content

Commit

Permalink
MDEV-18115: Remove fil_type_is_data()
Browse files Browse the repository at this point in the history
When commit 562c037
removed FIL_TYPE_LOG, the function fil_type_is_data()
became redundant, that is, always returning true for
a valid value of fil_space_t::purpose. Remove it.
  • Loading branch information
dr-m committed Apr 21, 2020
1 parent 9800344 commit 4db4397
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
11 changes: 2 additions & 9 deletions storage/innobase/fil/fil0fil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2982,8 +2982,6 @@ fil_ibd_open(
ut_ad(srv_log_file_size != 0);
}

ut_ad(fil_type_is_data(purpose));

/* Table flags can be ULINT_UNDEFINED if
dict_tf_to_fsp_flags_failure is set. */
if (flags == ULINT_UNDEFINED) {
Expand Down Expand Up @@ -4017,8 +4015,7 @@ fil_io(

/* Open file if closed */
if (!fil_node_prepare_for_io(node, space)) {
if (fil_type_is_data(space->purpose)
&& fil_is_user_tablespace_id(space->id)) {
if (fil_is_user_tablespace_id(space->id)) {
mutex_exit(&fil_system.mutex);

if (!ignore) {
Expand All @@ -4044,11 +4041,7 @@ fil_io(
ut_a(0);
}

/* Check that at least the start offset is within the bounds of a
single-table tablespace, including rollback tablespaces. */
if (node->size <= cur_page_no
&& space->id != TRX_SYS_SPACE
&& fil_type_is_data(space->purpose)) {
if (space->id && node->size <= cur_page_no) {
if (ignore) {
/* If we can tolerate the non-existent pages, we
should return with DB_ERROR and let caller decide
Expand Down
15 changes: 0 additions & 15 deletions storage/innobase/include/fil0fil.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ enum fil_type_t {
FIL_TYPE_TABLESPACE,
};

/** Check if fil_type is any of FIL_TYPE_TEMPORARY, FIL_TYPE_IMPORT
or FIL_TYPE_TABLESPACE.
@param[in] type variable of type fil_type_t
@return true if any of FIL_TYPE_TEMPORARY, FIL_TYPE_IMPORT
or FIL_TYPE_TABLESPACE */
inline
bool
fil_type_is_data(
fil_type_t type)
{
return(type == FIL_TYPE_TEMPORARY
|| type == FIL_TYPE_IMPORT
|| type == FIL_TYPE_TABLESPACE);
}

struct fil_node_t;

#endif
Expand Down

0 comments on commit 4db4397

Please sign in to comment.