diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-08 12:43:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-08 13:45:02 +0200 |
commit | 5ed54e78ac77a94aa37674ae0d484f687812f984 (patch) | |
tree | 7c4312e77eda7d2c8a7a31fd44ecfd521698bacd /storage/innobase/include | |
parent | 74b7d0182dc5966898da0f039cf059c3a8ad18f6 (diff) | |
download | mariadb-git-5ed54e78ac77a94aa37674ae0d484f687812f984.tar.gz |
Cleanup: Remove redundant XDES_FREE_BIT parameters
The page allocation bitmaps in the extent descriptor pages
contain two bits per page: XDES_FREE_BIT and XDES_CLEAN_BIT,
which is unused. Simplify read access.
xdes_is_free(descr,mtr): Remove. Use !xdes_get_n_used(descr) instead.
xdes_is_free(): Replaces xdes_get_bit(), xdes_mtr_get_bit().
xdes_find_free(): Replaces xdes_find_bit().
fsp_seg_inode_page_get_nth_inode(): Remove the redundant parameters
physical_size, mtr.
fsp_seg_inode_page_find_used(), fsp_seg_inode_page_find_free():
Remove the redundant parameter mtr.
Diffstat (limited to 'storage/innobase/include')
-rw-r--r-- | storage/innobase/include/fsp0fsp.h | 26 | ||||
-rw-r--r-- | storage/innobase/include/fsp0fsp.ic | 48 |
2 files changed, 12 insertions, 62 deletions
diff --git a/storage/innobase/include/fsp0fsp.h b/storage/innobase/include/fsp0fsp.h index 26da55bb2ad..a87f1fb2fe6 100644 --- a/storage/innobase/include/fsp0fsp.h +++ b/storage/innobase/include/fsp0fsp.h @@ -288,6 +288,18 @@ the extent are free and which contain old tuple version to clean. */ /** Offset of the descriptor array on a descriptor page */ #define XDES_ARR_OFFSET (FSP_HEADER_OFFSET + FSP_HEADER_SIZE) +/** +Determine if a page is marked free. +@param[in] descr extent descriptor +@param[in] offset page offset within extent +@return whether the page is free */ +inline bool xdes_is_free(const xdes_t *descr, ulint offset) +{ + ut_ad(offset < FSP_EXTENT_SIZE); + ulint index= XDES_FREE_BIT + XDES_BITS_PER_PAGE * offset; + return ut_bit_get_nth(descr[XDES_BITMAP + (index >> 3)], index & 7); +} + #ifndef UNIV_INNOCHECKSUM /* @} */ @@ -782,18 +794,6 @@ fsp_flags_match(ulint expected, ulint actual) return(actual == expected); } -/**********************************************************************//** -Gets a descriptor bit of a page. -@return TRUE if free */ -UNIV_INLINE -ibool -xdes_get_bit( -/*=========*/ - const xdes_t* descr, /*!< in: descriptor */ - ulint bit, /*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */ - ulint offset);/*!< in: page offset within extent: - 0 ... FSP_EXTENT_SIZE - 1 */ - /** Determine the descriptor index within a descriptor page. @param[in] zip_size ROW_FORMAT=COMPRESSED page size, or 0 @param[in] offset page offset @@ -833,6 +833,4 @@ inline ulint xdes_calc_descriptor_page(ulint zip_size, ulint offset) #endif /* UNIV_INNOCHECKSUM */ -#include "fsp0fsp.ic" - #endif diff --git a/storage/innobase/include/fsp0fsp.ic b/storage/innobase/include/fsp0fsp.ic deleted file mode 100644 index 31b9d8c5dbe..00000000000 --- a/storage/innobase/include/fsp0fsp.ic +++ /dev/null @@ -1,48 +0,0 @@ -/***************************************************************************** - -Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -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 -Foundation; version 2 of the License. - -This program is distributed in the hope that it will be useful, but WITHOUT -ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License along with -this program; if not, write to the Free Software Foundation, Inc., -51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA - -*****************************************************************************/ - -/**************************************************//** -@file include/fsp0fsp.ic -File space management - -Created 12/18/1995 Heikki Tuuri -*******************************************************/ - -/**********************************************************************//** -Gets a descriptor bit of a page. -@return TRUE if free */ -UNIV_INLINE -ibool -xdes_get_bit( -/*=========*/ - const xdes_t* descr, /*!< in: descriptor */ - ulint bit, /*!< in: XDES_FREE_BIT or XDES_CLEAN_BIT */ - ulint offset) /*!< in: page offset within extent: - 0 ... FSP_EXTENT_SIZE - 1 */ -{ - ut_ad(offset < FSP_EXTENT_SIZE); - ut_ad(bit == XDES_FREE_BIT || bit == XDES_CLEAN_BIT); - - ulint index = bit + XDES_BITS_PER_PAGE * offset; - - ulint bit_index = index % 8; - ulint byte_index = index / 8; - - return ut_bit_get_nth(descr[XDES_BITMAP + byte_index], bit_index); -} |