summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-04-06 12:24:36 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2019-04-06 21:25:43 +0300
commit56df18be65ffa007a4d2c20413d69aac0bb0bdbd (patch)
tree514b44baccc6b7d176308e965321c15abf6e5025
parent71f9552fd83ad155d541b2c2aa7c835f93cc47d3 (diff)
downloadmariadb-git-56df18be65ffa007a4d2c20413d69aac0bb0bdbd.tar.gz
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.
-rw-r--r--storage/innobase/fsp/fsp0fsp.cc42
-rw-r--r--storage/innobase/include/fsp0fsp.h15
-rw-r--r--storage/innobase/log/log0recv.cc2
3 files changed, 13 insertions, 46 deletions
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc
index 2e128594a4a..2798df9f126 100644
--- a/storage/innobase/fsp/fsp0fsp.cc
+++ b/storage/innobase/fsp/fsp0fsp.cc
@@ -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
@@ -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);
@@ -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
@@ -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
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h
index 8b9bbba5239..6f2fbff2174 100644
--- a/storage/innobase/include/fsp0fsp.h
+++ b/storage/innobase/include/fsp0fsp.h
@@ -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
@@ -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. */
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index 15bc6e1727c..ea9b5167420 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -1668,7 +1668,7 @@ parse_log:
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);