1 /*****************************************************************************
3 Copyright (c) 1995, 2009, Innobase Oy. All Rights Reserved.
5 This program is free software; you can redistribute it and/or modify it under
6 the terms of the GNU General Public License as published by the Free Software
7 Foundation; version 2 of the License.
9 This program is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License along with
14 this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17 *****************************************************************************/
19 /******************************************************************//**
20 @file include/fut0fut.ic
23 Created 12/13/1995 Heikki Tuuri
24 ***********************************************************************/
29 /********************************************************************//**
30 Gets a pointer to a file address and latches the page.
31 @return pointer to a byte in a frame; the file page in the frame is
32 bufferfixed and latched */
37 ulint space, /*!< in: space id */
38 ulint zip_size,/*!< in: compressed page size in bytes
39 or 0 for uncompressed pages */
40 fil_addr_t addr, /*!< in: file address */
41 ulint rw_latch, /*!< in: RW_S_LATCH, RW_X_LATCH */
42 mtr_t* mtr) /*!< in: mtr handle */
47 ut_ad(addr.boffset < UNIV_PAGE_SIZE);
48 ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH));
50 block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr);
51 ptr = buf_block_get_frame(block) + addr.boffset;
53 buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK);