函数fsp_get_space_header

 

/**********************************************************************//**
Gets a pointer to the space header and x-locks its page.
@return    pointer to the space header, page x-locked */
UNIV_INLINE
fsp_header_t*
fsp_get_space_header(
/*=================*/
    ulint    id,    /*!< in: space id */
    ulint    zip_size,/*!< in: compressed page size in bytes
            or 0 for uncompressed pages */
    mtr_t*    mtr)    /*!< in: mtr */
{
    buf_block_t*    block;
    fsp_header_t*    header;

    ut_ad(ut_is_2pow(zip_size));
    ut_ad(zip_size <= UNIV_PAGE_SIZE);
    ut_ad(!zip_size || zip_size >= PAGE_ZIP_MIN_SIZE);
    ut_ad(id || !zip_size);

    block = buf_page_get(id, zip_size, 0, RW_X_LATCH, mtr);
    header = FSP_HEADER_OFFSET + buf_block_get_frame(block);
    buf_block_dbg_add_level(block, SYNC_FSP_PAGE);

    ut_ad(id == mach_read_from_4(FSP_SPACE_ID + header));
    ut_ad(zip_size == dict_table_flags_to_zip_size(
              mach_read_from_4(FSP_SPACE_FLAGS + header)));
    return(header);
}


#define FSP_HEADER_OFFSET    FIL_PAGE_DATA
#define FIL_PAGE_DATA        38

 

你可能感兴趣的:(函数fsp_get_space_header)