diff options
Diffstat (limited to 'storage/innobase/include/fut0fut.ic')
-rw-r--r-- | storage/innobase/include/fut0fut.ic | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/storage/innobase/include/fut0fut.ic b/storage/innobase/include/fut0fut.ic index b065b10b9ca..6fe031876e6 100644 --- a/storage/innobase/include/fut0fut.ic +++ b/storage/innobase/include/fut0fut.ic @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 1995, 2009, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 1995, 2015, Oracle and/or its affiliates. All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -26,31 +26,43 @@ Created 12/13/1995 Heikki Tuuri #include "sync0rw.h" #include "buf0buf.h" -/********************************************************************//** -Gets a pointer to a file address and latches the page. -@return pointer to a byte in a frame; the file page in the frame is +/** Gets a pointer to a file address and latches the page. +@param[in] space space id +@param[in] page_size page size +@param[in] addr file address +@param[in] rw_latch RW_S_LATCH, RW_X_LATCH, RW_SX_LATCH +@param[in,out] mtr mini-transaction +@param[out] ptr_block file page +@return pointer to a byte in (*ptr_block)->frame; the *ptr_block is bufferfixed and latched */ UNIV_INLINE byte* fut_get_ptr( -/*========*/ - ulint space, /*!< in: space id */ - ulint zip_size,/*!< in: compressed page size in bytes - or 0 for uncompressed pages */ - fil_addr_t addr, /*!< in: file address */ - ulint rw_latch, /*!< in: RW_S_LATCH, RW_X_LATCH */ - mtr_t* mtr) /*!< in: mtr handle */ + ulint space, + const page_size_t& page_size, + fil_addr_t addr, + rw_lock_type_t rw_latch, + mtr_t* mtr, + buf_block_t** ptr_block) { buf_block_t* block; - byte* ptr; + byte* ptr = NULL; ut_ad(addr.boffset < UNIV_PAGE_SIZE); - ut_ad((rw_latch == RW_S_LATCH) || (rw_latch == RW_X_LATCH)); + ut_ad((rw_latch == RW_S_LATCH) + || (rw_latch == RW_X_LATCH) + || (rw_latch == RW_SX_LATCH)); + + block = buf_page_get(page_id_t(space, addr.page), page_size, + rw_latch, mtr); - block = buf_page_get(space, zip_size, addr.page, rw_latch, mtr); ptr = buf_block_get_frame(block) + addr.boffset; buf_block_dbg_add_level(block, SYNC_NO_ORDER_CHECK); + if (ptr_block != NULL) { + *ptr_block = block; + } + return(ptr); } |