码迷,mamicode.com
首页 > 其他好文 > 详细

函数fsp_get_space_header

时间:2015-11-16 15:48:02      阅读:153      评论:0      收藏:0      [点我收藏+]

标签:

 

/**********************************************************************//**
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

标签:

原文地址:http://www.cnblogs.com/taek/p/4968757.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!