diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-02-06 19:50:11 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-02-07 12:21:35 +0200 |
commit | 0a1c3477bf359c55be3e11ec6502bc7b5bb87f29 (patch) | |
tree | 2e8ed1a03499e22281dc2c6406d06b63fe7d6f1b /storage/innobase/include/ibuf0ibuf.ic | |
parent | 10dac4293f39863552ce2ec8a28629882c92f4d9 (diff) | |
download | mariadb-git-0a1c3477bf359c55be3e11ec6502bc7b5bb87f29.tar.gz |
MDEV-18493 Remove page_size_t
MySQL 5.7 introduced the class page_size_t and increased the size of
buffer pool page descriptors by introducing this object to them.
Maybe the intention of this exercise was to prepare for a future
where the buffer pool could accommodate multiple page sizes.
But that future never arrived, not even in MySQL 8.0. It is much
easier to manage a pool of a single page size, and typically all
storage devices of an InnoDB instance benefit from using the same
page size.
Let us remove page_size_t from MariaDB Server. This will make it
easier to remove support for ROW_FORMAT=COMPRESSED (or make it a
compile-time option) in the future, just by removing various
occurrences of zip_size.
Diffstat (limited to 'storage/innobase/include/ibuf0ibuf.ic')
-rw-r--r-- | storage/innobase/include/ibuf0ibuf.ic | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/storage/innobase/include/ibuf0ibuf.ic b/storage/innobase/include/ibuf0ibuf.ic index e35b8a252a7..5be9569290b 100644 --- a/storage/innobase/include/ibuf0ibuf.ic +++ b/storage/innobase/include/ibuf0ibuf.ic @@ -150,20 +150,6 @@ ibuf_inside( return(mtr->is_inside_ibuf()); } -/** Checks if a page address is an ibuf bitmap page (level 3 page) address. -@param[in] page_id page id -@param[in] page_size page size -@return TRUE if a bitmap page */ -UNIV_INLINE -ibool -ibuf_bitmap_page( - const page_id_t page_id, - const page_size_t& page_size) -{ - return((page_id.page_no() & (page_size.physical() - 1)) - == FSP_IBUF_BITMAP_OFFSET); -} - /** Translates the free space on a page to a value in the ibuf bitmap. @param[in] page_size page size in bytes @param[in] max_ins_size maximum insert size after reorganize for @@ -192,29 +178,6 @@ ibuf_index_page_calc_free_bits( return(n); } -/** Translates the ibuf free bits to the free space on a page in bytes. -@param[in] page_size page_size -@param[in] bits value for ibuf bitmap bits -@return maximum insert size after reorganize for the page */ -UNIV_INLINE -ulint -ibuf_index_page_calc_free_from_bits( - const page_size_t& page_size, - ulint bits) -{ - ut_ad(bits < 4); - ut_ad(!page_size.is_compressed() - || page_size.physical() > IBUF_PAGE_SIZE_PER_FREE_SPACE); - - if (bits == 3) { - return(4 * page_size.physical() - / IBUF_PAGE_SIZE_PER_FREE_SPACE); - } - - return(bits * (page_size.physical() - / IBUF_PAGE_SIZE_PER_FREE_SPACE)); -} - /*********************************************************************//** Translates the free space on a compressed page to a value in the ibuf bitmap. @return value for ibuf bitmap bits */ @@ -228,7 +191,7 @@ ibuf_index_page_calc_free_zip( const page_zip_des_t* page_zip; lint zip_max_ins; - ut_ad(block->page.size.is_compressed()); + ut_ad(block->page.zip.data); /* Consider the maximum insert size on the uncompressed page without reorganizing the page. We must not assume anything @@ -251,7 +214,7 @@ ibuf_index_page_calc_free_zip( max_ins_size = (ulint) zip_max_ins; } - return(ibuf_index_page_calc_free_bits(block->page.size.physical(), + return(ibuf_index_page_calc_free_bits(block->physical_size(), max_ins_size)); } @@ -264,14 +227,14 @@ ibuf_index_page_calc_free( /*======================*/ const buf_block_t* block) /*!< in: buffer block */ { - if (!block->page.size.is_compressed()) { + if (!block->page.zip.data) { ulint max_ins_size; max_ins_size = page_get_max_insert_size_after_reorganize( buf_block_get_frame(block), 1); return(ibuf_index_page_calc_free_bits( - block->page.size.physical(), max_ins_size)); + block->physical_size(), max_ins_size)); } else { return(ibuf_index_page_calc_free_zip(block)); } @@ -312,12 +275,12 @@ ibuf_update_free_bits_if_full( ut_ad(buf_block_get_page_zip(block) == NULL); before = ibuf_index_page_calc_free_bits( - block->page.size.physical(), max_ins_size); + srv_page_size, max_ins_size); if (max_ins_size >= increase) { compile_time_assert(ULINT32_UNDEFINED > UNIV_PAGE_SIZE_MAX); after = ibuf_index_page_calc_free_bits( - block->page.size.physical(), max_ins_size - increase); + srv_page_size, max_ins_size - increase); #ifdef UNIV_IBUF_DEBUG ut_a(after <= ibuf_index_page_calc_free(block)); #endif |