Commit fc2ca2be authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21024: Clean up page allocation

fsp_alloc_seg_inode_page(): Ever since
commit 3926673c
all newly allocated pages are zero-initialized.
Assert that this is the case for the FSEG_ID fields.
parent 98e1d603
...@@ -1681,9 +1681,7 @@ fsp_alloc_seg_inode_page( ...@@ -1681,9 +1681,7 @@ fsp_alloc_seg_inode_page(
fsp_header_t* space_header, fsp_header_t* space_header,
mtr_t* mtr) mtr_t* mtr)
{ {
fseg_inode_t* inode;
buf_block_t* block; buf_block_t* block;
page_t* page;
ut_ad(page_offset(space_header) == FSP_HEADER_OFFSET); ut_ad(page_offset(space_header) == FSP_HEADER_OFFSET);
ut_ad(page_get_space_id(page_align(space_header)) == space->id); ut_ad(page_get_space_id(page_align(space_header)) == space->id);
...@@ -1701,22 +1699,20 @@ fsp_alloc_seg_inode_page( ...@@ -1701,22 +1699,20 @@ fsp_alloc_seg_inode_page(
buf_block_dbg_add_level(block, SYNC_FSP_PAGE); buf_block_dbg_add_level(block, SYNC_FSP_PAGE);
ut_ad(rw_lock_get_sx_lock_count(&block->lock) == 1); ut_ad(rw_lock_get_sx_lock_count(&block->lock) == 1);
page = buf_block_get_frame(block); mlog_write_ulint(block->frame + FIL_PAGE_TYPE, FIL_PAGE_INODE,
mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_INODE,
MLOG_2BYTES, mtr); MLOG_2BYTES, mtr);
for (ulint i = 0; i < FSP_SEG_INODES_PER_PAGE(page_size); i++) { #ifdef UNIV_DEBUG
const byte* inode = FSEG_ID + FSEG_ARR_OFFSET + block->frame;
inode = fsp_seg_inode_page_get_nth_inode( for (ulint i = FSP_SEG_INODES_PER_PAGE(page_size); i--;
page, i, page_size, mtr); inode += FSEG_INODE_SIZE) {
ut_ad(!mach_read_from_8(inode));
mlog_write_ull(inode + FSEG_ID, 0, mtr);
} }
#endif
flst_add_last( flst_add_last(
space_header + FSP_SEG_INODES_FREE, space_header + FSP_SEG_INODES_FREE,
page + FSEG_INODE_PAGE_NODE, mtr); block->frame + FSEG_INODE_PAGE_NODE, mtr);
return(true); return(true);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment