~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/innobase/include/fut0fut.ic

  • Committer: Monty Taylor
  • Date: 2008-10-30 19:42:06 UTC
  • mto: (520.4.38 devel)
  • mto: This revision was merged to the branch mainline in revision 572.
  • Revision ID: monty@inaugust.com-20081030194206-fzus6yqlw1ekru65
Removed handler from common_includes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/**********************************************************************
 
2
File-based utilities
 
3
 
 
4
(c) 1995 Innobase Oy
 
5
 
 
6
Created 12/13/1995 Heikki Tuuri
 
7
***********************************************************************/
 
8
 
 
9
#include "sync0rw.h"
 
10
#include "buf0buf.h"
 
11
 
 
12
/************************************************************************
 
13
Gets a pointer to a file address and latches the page. */
 
14
UNIV_INLINE
 
15
byte*
 
16
fut_get_ptr(
 
17
/*========*/
 
18
                                /* out: pointer to a byte in a frame; the file
 
19
                                page in the frame is bufferfixed and latched */
 
20
        ulint           space,  /* in: space id */
 
21
        ulint           zip_size,/* in: compressed page size in bytes
 
22
                                or 0 for uncompressed pages */
 
23
        fil_addr_t      addr,   /* in: file address */
 
24
        ulint           rw_latch, /* in: RW_S_LATCH, RW_X_LATCH */
 
25
        mtr_t*          mtr)    /* in: mtr handle */
 
26
{
 
27
        buf_block_t*    block;
 
28
        byte*           ptr;
 
29
 
 
30
        ut_ad(addr.boffset < UNIV_PAGE_SIZE);
 
31
        ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
 
32
 
 
33
        block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr);
 
34
        ptr = buf_block_get_frame(block) + addr.boffset;
 
35
 
 
36
#ifdef UNIV_SYNC_DEBUG
 
37
        buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);
 
38
#endif /* UNIV_SYNC_DEBUG */
 
39
 
 
40
        return(ptr);
 
41
}