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

函数buf_page_hash_get_low

时间:2015-11-25 21:49:33      阅读:277      评论:0      收藏:0      [点我收藏+]

标签:

 

/******************************************************************//**
Returns the control block of a file page, NULL if not found.
@return    block, NULL if not found */
UNIV_INLINE
buf_page_t*
buf_page_hash_get_low(
/*==================*/
    buf_pool_t*    buf_pool,    /*!< buffer pool instance */
    ulint        space,        /*!< in: space id */
    ulint        offset,        /*!< in: offset of the page
                    within space */
    ulint        fold)        /*!< in: buf_page_address_fold(
                    space, offset) */
{
    buf_page_t*    bpage;

    ut_ad(buf_pool);
    ut_ad(buf_pool_mutex_own(buf_pool));
    ut_ad(fold == buf_page_address_fold(space, offset));

    /* Look for the page in the hash table */

    HASH_SEARCH(hash, buf_pool->page_hash, fold, buf_page_t*, bpage,
            ut_ad(bpage->in_page_hash && !bpage->in_zip_hash
              && buf_page_in_file(bpage)),
            bpage->space == space && bpage->offset == offset);
    if (bpage) {
        ut_a(buf_page_in_file(bpage));
        ut_ad(bpage->in_page_hash);
        ut_ad(!bpage->in_zip_hash);
#if UNIV_WORD_SIZE == 4
        /* On 32-bit systems, there is no padding in
        buf_page_t.  On other systems, Valgrind could complain
        about uninitialized pad bytes. */
        UNIV_MEM_ASSERT_RW(bpage, sizeof *bpage);
#endif
    }

    return(bpage);
}

 

函数buf_page_hash_get_low

标签:

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

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