Clean up the parsing of MLOG_INIT_FILE_PAGE2

fsp_apply_init_file_page(): Renamed from fsp_init_file_page_low().

fsp_parse_init_file_page(): Remove. The redo log record has no
parameters.
This commit is contained in:
Marko Mäkelä 2019-04-06 12:24:36 +03:00
commit 56df18be65
3 changed files with 13 additions and 46 deletions

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, 2018, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -588,13 +588,9 @@ xdes_get_offset(
* FSP_EXTENT_SIZE); * FSP_EXTENT_SIZE);
} }
/***********************************************************//** /** Initialize a file page whose prior contents should be ignored.
Inits a file page whose prior contents should be ignored. */ @param[in,out] block buffer pool block */
static void fsp_apply_init_file_page(buf_block_t* block)
void
fsp_init_file_page_low(
/*===================*/
buf_block_t* block) /*!< in: pointer to a page */
{ {
page_t* page = buf_block_get_frame(block); page_t* page = buf_block_get_frame(block);
@ -653,14 +649,10 @@ fsp_space_modify_check(
/** Initialize a file page. /** Initialize a file page.
@param[in,out] block file page @param[in,out] block file page
@param[in,out] mtr mini-transaction */ @param[in,out] mtr mini-transaction */
static static void fsp_init_file_page(buf_block_t* block, mtr_t* mtr)
void
fsp_init_file_page(buf_block_t* block, mtr_t* mtr)
{ {
fsp_init_file_page_low(block); fsp_apply_init_file_page(block);
mlog_write_initial_log_record(block->frame, MLOG_INIT_FILE_PAGE2, mtr);
mlog_write_initial_log_record(buf_block_get_frame(block),
MLOG_INIT_FILE_PAGE2, mtr);
} }
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
@ -676,26 +668,6 @@ fsp_init_file_page(const fil_space_t* space, buf_block_t* block, mtr_t* mtr)
# define fsp_init_file_page(space, block, mtr) fsp_init_file_page(block, mtr) # define fsp_init_file_page(space, block, mtr) fsp_init_file_page(block, mtr)
#endif #endif
/***********************************************************//**
Parses a redo log record of a file page init.
@return end of log record or NULL */
byte*
fsp_parse_init_file_page(
/*=====================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr MY_ATTRIBUTE((unused)), /*!< in: buffer end */
buf_block_t* block) /*!< in: block or NULL */
{
ut_ad(ptr != NULL);
ut_ad(end_ptr != NULL);
if (block) {
fsp_init_file_page_low(block);
}
return(ptr);
}
/**********************************************************************//** /**********************************************************************//**
Initializes the fsp system. */ Initializes the fsp system. */
void void

View file

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2013, 2017, MariaDB Corporation. Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -684,15 +684,10 @@ fsp_descr_page(
const page_id_t page_id, const page_id_t page_id,
const page_size_t& page_size); const page_size_t& page_size);
/***********************************************************//** /** Initialize a file page whose prior contents should be ignored.
Parses a redo log record of a file page init. @param[in,out] block buffer pool block */
@return end of log record or NULL */ void fsp_apply_init_file_page(buf_block_t* block);
byte*
fsp_parse_init_file_page(
/*=====================*/
byte* ptr, /*!< in: buffer */
byte* end_ptr, /*!< in: buffer end */
buf_block_t* block); /*!< in: block or NULL */
#ifdef UNIV_BTR_PRINT #ifdef UNIV_BTR_PRINT
/*******************************************************************//** /*******************************************************************//**
Writes info of a segment. */ Writes info of a segment. */

View file

@ -1668,7 +1668,7 @@ parse_log:
break; break;
case MLOG_INIT_FILE_PAGE2: case MLOG_INIT_FILE_PAGE2:
/* Allow anything in page_type when creating a page. */ /* Allow anything in page_type when creating a page. */
ptr = fsp_parse_init_file_page(ptr, end_ptr, block); if (block) fsp_apply_init_file_page(block);
break; break;
case MLOG_WRITE_STRING: case MLOG_WRITE_STRING:
ptr = mlog_parse_string(ptr, end_ptr, page, page_zip); ptr = mlog_parse_string(ptr, end_ptr, page, page_zip);