mariadb/include/fsp0fsp.ic
marko 5837f75150 branches/zip: Cleanup suggested by Osku.
ut_is_2pow(): New function for testing if a number is zero or a power of two.
Use this function instead of bitwise arithmetics or ut_2_power_up() where
possible.
2006-06-07 11:23:21 +00:00

28 lines
756 B
Text

/******************************************************
File space management
(c) 1995 Innobase Oy
Created 12/18/1995 Heikki Tuuri
*******************************************************/
/***************************************************************************
Checks if a page address is an extent descriptor page address. */
UNIV_INLINE
ibool
fsp_descr_page(
/*===========*/
/* out: TRUE if a descriptor page */
ulint zip_size,/* in: compressed page size in bytes;
0 for uncompressed pages */
ulint page_no)/* in: page number */
{
ut_ad(ut_is_2pow(zip_size));
if (!zip_size) {
return(UNIV_UNLIKELY((page_no & (UNIV_PAGE_SIZE - 1))
== FSP_XDES_OFFSET));
}
return(UNIV_UNLIKELY((page_no & (zip_size - 1)) == FSP_XDES_OFFSET));
}