From b7867623ae0ae54a7bf541404573d46f5e815624 Mon Sep 17 00:00:00 2001 From: marko <> Date: Fri, 13 Oct 2006 13:03:06 +0000 Subject: [PATCH] branches/zip: buf_ptr_get_fsp_addr(): Change parameter ptr to const void*, and remove the buf_block_align() call. --- include/buf0buf.h | 2 +- include/buf0buf.ic | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/buf0buf.h b/include/buf0buf.h index 8155ec7b78a..2bc1071b30a 100644 --- a/include/buf0buf.h +++ b/include/buf0buf.h @@ -427,7 +427,7 @@ UNIV_INLINE void buf_ptr_get_fsp_addr( /*=================*/ - byte* ptr, /* in: pointer to a buffer frame */ + const void* ptr, /* in: pointer to a buffer frame */ ulint* space, /* out: space id */ fil_addr_t* addr); /* out: page offset and byte offset */ /************************************************************************** diff --git a/include/buf0buf.ic b/include/buf0buf.ic index ca1124ecf15..a7b04ea45c3 100644 --- a/include/buf0buf.ic +++ b/include/buf0buf.ic @@ -281,16 +281,15 @@ UNIV_INLINE void buf_ptr_get_fsp_addr( /*=================*/ - byte* ptr, /* in: pointer to a buffer frame */ + const void* ptr, /* in: pointer to a buffer frame */ ulint* space, /* out: space id */ fil_addr_t* addr) /* out: page offset and byte offset */ { - buf_block_t* block; + const page_t* page = ut_align_down((void*) ptr, UNIV_PAGE_SIZE); + ut_ad(buf_block_align(ptr)); - block = buf_block_align(ptr); - - *space = buf_block_get_space(block); - addr->page = buf_block_get_page_no(block); + *space = mach_read_from_4(page + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); + addr->page = mach_read_from_4(page + FIL_PAGE_OFFSET); addr->boffset = ut_align_offset(ptr, UNIV_PAGE_SIZE); }