分配一个新的inode page
/**********************************************************************//** Allocates a new file segment inode page. @return TRUE if could be allocated */ static ibool fsp_alloc_seg_inode_page( /*=====================*/ fsp_header_t* space_header, /*!< in: space header */ mtr_t* mtr) /*!< in: mini-transaction handle */ { fseg_inode_t* inode; buf_block_t* block; page_t* page; ulint space; ulint zip_size; ulint i; ut_ad(page_offset(space_header) == FSP_HEADER_OFFSET); space = page_get_space_id(page_align(space_header)); zip_size = dict_table_flags_to_zip_size(mach_read_from_4(FSP_SPACE_FLAGS + space_header)); block = fsp_alloc_free_page(space, zip_size, 0, mtr, mtr); //详见 if (block == NULL) { return(FALSE); } buf_block_dbg_add_level(block, SYNC_FSP_PAGE); ut_ad(rw_lock_get_x_lock_count(&block->lock) == 1); block->check_index_page_at_flush = FALSE; page = buf_block_get_frame(block); mlog_write_ulint(page + FIL_PAGE_TYPE, FIL_PAGE_INODE,MLOG_2BYTES, mtr); for (i = 0; i < FSP_SEG_INODES_PER_PAGE(zip_size); i++) { inode = fsp_seg_inode_page_get_nth_inode(page, i,zip_size, mtr); mlog_write_ull(inode + FSEG_ID, 0, mtr); } flst_add_last(space_header + FSP_SEG_INODES_FREE,page + FSEG_INODE_PAGE_NODE, mtr);//详见 return(TRUE); }
时间: 2024-12-18 22:38:48