函数buf_ptr_get_fsp_addr

 #define FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID  34

函数buf_ptr_get_fsp_addr_第1张图片

/**********************************************************************//**
Gets the space id, page offset, and byte offset within page of a
pointer pointing to a buffer frame containing a file page. */
UNIV_INLINE
void
buf_ptr_get_fsp_addr(
/*=================*/
    const void*    ptr,    /*!< in: pointer to a buffer frame */
    ulint*        space,    /*!< out: space id */
    fil_addr_t*    addr)    /*!< out: page offset and byte offset */
{
    const page_t*    page = (const page_t*) ut_align_down(ptr,
                                 UNIV_PAGE_SIZE);

    *space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID);
    addr->page = mach_read_from_4(page + FIL_PAGE_OFFSET);
    addr->boffset = ut_align_offset(ptr, UNIV_PAGE_SIZE);
}

 

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