Skip to content

Commit

Permalink
Clean up the parsing of MLOG_INIT_FILE_PAGE2
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Apr 6, 2019
1 parent 71f9552 commit 56df18b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 46 deletions.
42 changes: 7 additions & 35 deletions storage/innobase/fsp/fsp0fsp.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -588,13 +588,9 @@ xdes_get_offset(
* FSP_EXTENT_SIZE);
}

/***********************************************************//**
Inits a file page whose prior contents should be ignored. */
static
void
fsp_init_file_page_low(
/*===================*/
buf_block_t* block) /*!< in: pointer to a page */
/** Initialize a file page whose prior contents should be ignored.
@param[in,out] block buffer pool block */
void fsp_apply_init_file_page(buf_block_t* block)
{
page_t* page = buf_block_get_frame(block);

Expand Down Expand Up @@ -653,14 +649,10 @@ fsp_space_modify_check(
/** Initialize a file page.
@param[in,out] block file page
@param[in,out] mtr mini-transaction */
static
void
fsp_init_file_page(buf_block_t* block, mtr_t* mtr)
static void fsp_init_file_page(buf_block_t* block, mtr_t* mtr)
{
fsp_init_file_page_low(block);

mlog_write_initial_log_record(buf_block_get_frame(block),
MLOG_INIT_FILE_PAGE2, mtr);
fsp_apply_init_file_page(block);
mlog_write_initial_log_record(block->frame, MLOG_INIT_FILE_PAGE2, mtr);
}

#ifdef UNIV_DEBUG
Expand All @@ -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)
#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. */
void
Expand Down
15 changes: 5 additions & 10 deletions storage/innobase/include/fsp0fsp.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -684,15 +684,10 @@ fsp_descr_page(
const page_id_t page_id,
const page_size_t& page_size);

/***********************************************************//**
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, /*!< in: buffer end */
buf_block_t* block); /*!< in: block or NULL */
/** Initialize a file page whose prior contents should be ignored.
@param[in,out] block buffer pool block */
void fsp_apply_init_file_page(buf_block_t* block);

#ifdef UNIV_BTR_PRINT
/*******************************************************************//**
Writes info of a segment. */
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1668,7 +1668,7 @@ recv_parse_or_apply_log_rec_body(
break;
case MLOG_INIT_FILE_PAGE2:
/* 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;
case MLOG_WRITE_STRING:
ptr = mlog_parse_string(ptr, end_ptr, page, page_zip);
Expand Down

0 comments on commit 56df18b

Please sign in to comment.