Commit a2121234 authored by marko's avatar marko

branches/zip: page_zip_validate(): Replace buf_frame_alloc() with

ut_malloc() to avoid breaking the latching order.

page_rec_check(), page_dir_slot_get_rec(): Replace buf_frame_align()
with ut_align_down() to avoid assertion failures in page_zip_validate().
parent a201d0c1
...@@ -501,7 +501,7 @@ page_rec_check( ...@@ -501,7 +501,7 @@ page_rec_check(
ut_a(rec); ut_a(rec);
page = buf_frame_align(rec); page = ut_align_down(rec, UNIV_PAGE_SIZE);
ut_a(rec <= page_header_get_ptr(page, PAGE_HEAP_TOP)); ut_a(rec <= page_header_get_ptr(page, PAGE_HEAP_TOP));
ut_a(rec >= page + PAGE_DATA); ut_a(rec >= page + PAGE_DATA);
...@@ -518,7 +518,7 @@ page_dir_slot_get_rec( ...@@ -518,7 +518,7 @@ page_dir_slot_get_rec(
/* out: pointer to record */ /* out: pointer to record */
page_dir_slot_t* slot) /* in: directory slot */ page_dir_slot_t* slot) /* in: directory slot */
{ {
return(buf_frame_align(slot) + mach_read_from_2(slot)); return(ut_align_down(slot, UNIV_PAGE_SIZE) + mach_read_from_2(slot));
} }
/******************************************************************* /*******************************************************************
......
...@@ -1996,6 +1996,7 @@ page_zip_validate( ...@@ -1996,6 +1996,7 @@ page_zip_validate(
const page_t* page) /* in: uncompressed page */ const page_t* page) /* in: uncompressed page */
{ {
page_zip_des_t temp_page_zip = *page_zip; page_zip_des_t temp_page_zip = *page_zip;
byte* temp_page_buf;
page_t* temp_page; page_t* temp_page;
ibool valid; ibool valid;
...@@ -2016,7 +2017,10 @@ page_zip_validate( ...@@ -2016,7 +2017,10 @@ page_zip_validate(
return(TRUE); return(TRUE);
} }
temp_page = buf_frame_alloc(); /* page_zip_decompress() expects the uncompressed page to be
UNIV_PAGE_SIZE aligned. */
temp_page_buf = ut_malloc(2 * UNIV_PAGE_SIZE);
temp_page = ut_align(temp_page_buf, UNIV_PAGE_SIZE);
valid = page_zip_decompress(&temp_page_zip, temp_page); valid = page_zip_decompress(&temp_page_zip, temp_page);
if (!valid) { if (!valid) {
...@@ -2052,7 +2056,7 @@ page_zip_validate( ...@@ -2052,7 +2056,7 @@ page_zip_validate(
} }
func_exit: func_exit:
buf_frame_free(temp_page); ut_free(temp_page_buf);
return(valid); return(valid);
} }
#endif /* UNIV_ZIP_DEBUG */ #endif /* UNIV_ZIP_DEBUG */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment