Skip to content

Commit 4db4397

Browse files
committed
MDEV-18115: Remove fil_type_is_data()
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.
1 parent 9800344 commit 4db4397

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

storage/innobase/fil/fil0fil.cc

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2982,8 +2982,6 @@ fil_ibd_open(
29822982
ut_ad(srv_log_file_size != 0);
29832983
}
29842984

2985-
ut_ad(fil_type_is_data(purpose));
2986-
29872985
/* Table flags can be ULINT_UNDEFINED if
29882986
dict_tf_to_fsp_flags_failure is set. */
29892987
if (flags == ULINT_UNDEFINED) {
@@ -4017,8 +4015,7 @@ fil_io(
40174015

40184016
/* Open file if closed */
40194017
if (!fil_node_prepare_for_io(node, space)) {
4020-
if (fil_type_is_data(space->purpose)
4021-
&& fil_is_user_tablespace_id(space->id)) {
4018+
if (fil_is_user_tablespace_id(space->id)) {
40224019
mutex_exit(&fil_system.mutex);
40234020

40244021
if (!ignore) {
@@ -4044,11 +4041,7 @@ fil_io(
40444041
ut_a(0);
40454042
}
40464043

4047-
/* Check that at least the start offset is within the bounds of a
4048-
single-table tablespace, including rollback tablespaces. */
4049-
if (node->size <= cur_page_no
4050-
&& space->id != TRX_SYS_SPACE
4051-
&& fil_type_is_data(space->purpose)) {
4044+
if (space->id && node->size <= cur_page_no) {
40524045
if (ignore) {
40534046
/* If we can tolerate the non-existent pages, we
40544047
should return with DB_ERROR and let caller decide

storage/innobase/include/fil0fil.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -60,21 +60,6 @@ enum fil_type_t {
6060
FIL_TYPE_TABLESPACE,
6161
};
6262

63-
/** Check if fil_type is any of FIL_TYPE_TEMPORARY, FIL_TYPE_IMPORT
64-
or FIL_TYPE_TABLESPACE.
65-
@param[in] type variable of type fil_type_t
66-
@return true if any of FIL_TYPE_TEMPORARY, FIL_TYPE_IMPORT
67-
or FIL_TYPE_TABLESPACE */
68-
inline
69-
bool
70-
fil_type_is_data(
71-
fil_type_t type)
72-
{
73-
return(type == FIL_TYPE_TEMPORARY
74-
|| type == FIL_TYPE_IMPORT
75-
|| type == FIL_TYPE_TABLESPACE);
76-
}
77-
7863
struct fil_node_t;
7964

8065
#endif

0 commit comments

Comments
 (0)