Commit 49d25239 authored by marko's avatar marko

branches/zip: Remove remaining occurrences of XDES_DESCRIBED_PER_PAGE.

mlog_parse_string(): Remove an off-by-one error in an assertion.

fil_extend_space_to_desired_size(): fsp_header_get_free_limit(),
fsp_try_extend_data_file(): Replace UNIV_PAGE_SIZE with the actual page size.

PAGE_ZIP_MIN_SIZE: New constant, to be used in assertions.

FSP_SEG_INODES_PER_PAGE: Add parameter zip_size.

fsp_seg_inode_page_get_nth_inode(), fsp_seg_inode_page_find_used(),
fsp_seg_inode_page_find_free(): Add parameter zip_size.
parent 8b14f397
...@@ -3583,6 +3583,7 @@ fil_extend_space_to_desired_size( ...@@ -3583,6 +3583,7 @@ fil_extend_space_to_desired_size(
ulint file_start_page_no; ulint file_start_page_no;
ulint offset_high; ulint offset_high;
ulint offset_low; ulint offset_low;
ulint page_size;
ibool success = TRUE; ibool success = TRUE;
fil_mutex_enter_and_prepare_for_io(space_id); fil_mutex_enter_and_prepare_for_io(space_id);
...@@ -3601,6 +3602,11 @@ fil_extend_space_to_desired_size( ...@@ -3601,6 +3602,11 @@ fil_extend_space_to_desired_size(
return(TRUE); return(TRUE);
} }
page_size = space->zip_size;
if (!page_size) {
page_size = UNIV_PAGE_SIZE;
}
node = UT_LIST_GET_LAST(space->chain); node = UT_LIST_GET_LAST(space->chain);
fil_node_prepare_for_io(node, system, space); fil_node_prepare_for_io(node, system, space);
...@@ -3610,30 +3616,30 @@ fil_extend_space_to_desired_size( ...@@ -3610,30 +3616,30 @@ fil_extend_space_to_desired_size(
/* Extend at most 64 pages at a time */ /* Extend at most 64 pages at a time */
buf_size = ut_min(64, size_after_extend - start_page_no) buf_size = ut_min(64, size_after_extend - start_page_no)
* UNIV_PAGE_SIZE; * page_size;
buf2 = mem_alloc(buf_size + UNIV_PAGE_SIZE); buf2 = mem_alloc(buf_size + page_size);
buf = ut_align(buf2, UNIV_PAGE_SIZE); buf = ut_align(buf2, page_size);
memset(buf, 0, buf_size); memset(buf, 0, buf_size);
while (start_page_no < size_after_extend) { while (start_page_no < size_after_extend) {
ulint n_pages = ut_min(buf_size / UNIV_PAGE_SIZE, ulint n_pages = ut_min(buf_size / page_size,
size_after_extend - start_page_no); size_after_extend - start_page_no);
offset_high = (start_page_no - file_start_page_no) offset_high = (start_page_no - file_start_page_no)
/ (4096 * ((1024 * 1024) / UNIV_PAGE_SIZE)); / (4096 * ((1024 * 1024) / page_size));
offset_low = ((start_page_no - file_start_page_no) offset_low = ((start_page_no - file_start_page_no)
% (4096 * ((1024 * 1024) / UNIV_PAGE_SIZE))) % (4096 * ((1024 * 1024) / page_size)))
* UNIV_PAGE_SIZE; * page_size;
#ifdef UNIV_HOTBACKUP #ifdef UNIV_HOTBACKUP
success = os_file_write(node->name, node->handle, buf, success = os_file_write(node->name, node->handle, buf,
offset_low, offset_high, offset_low, offset_high,
UNIV_PAGE_SIZE * n_pages); page_size * n_pages);
#else #else
success = os_aio(OS_FILE_WRITE, OS_AIO_SYNC, success = os_aio(OS_FILE_WRITE, OS_AIO_SYNC,
node->name, node->handle, buf, node->name, node->handle, buf,
offset_low, offset_high, offset_low, offset_high,
UNIV_PAGE_SIZE * n_pages, page_size * n_pages,
NULL, NULL); NULL, NULL);
#endif #endif
if (success) { if (success) {
...@@ -3647,7 +3653,7 @@ fil_extend_space_to_desired_size( ...@@ -3647,7 +3653,7 @@ fil_extend_space_to_desired_size(
n_pages = ((ulint) n_pages = ((ulint)
(os_file_get_size_as_iblonglong(node->handle) (os_file_get_size_as_iblonglong(node->handle)
/ UNIV_PAGE_SIZE)) - node->size; / page_size)) - node->size;
node->size += n_pages; node->size += n_pages;
space->size += n_pages; space->size += n_pages;
...@@ -3666,7 +3672,7 @@ fil_extend_space_to_desired_size( ...@@ -3666,7 +3672,7 @@ fil_extend_space_to_desired_size(
#ifndef UNIV_HOTBACKUP #ifndef UNIV_HOTBACKUP
if (space_id == 0) { if (space_id == 0) {
ulint pages_per_mb = (1024 * 1024) / UNIV_PAGE_SIZE; ulint pages_per_mb = (1024 * 1024) / page_size;
/* Keep the last data file size info up to date, rounded to /* Keep the last data file size info up to date, rounded to
full megabytes */ full megabytes */
......
This diff is collapsed.
...@@ -369,7 +369,8 @@ fseg_print( ...@@ -369,7 +369,8 @@ fseg_print(
/* Number of pages described in a single descriptor page: currently each page /* Number of pages described in a single descriptor page: currently each page
description takes less than 1 byte; a descriptor page is repeated every description takes less than 1 byte; a descriptor page is repeated every
this many file pages */ this many file pages */
#define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE /* #define XDES_DESCRIBED_PER_PAGE UNIV_PAGE_SIZE */
/* This has been replaced with either UNIV_PAGE_SIZE or page_zip->size. */
/* The space low address page map */ /* The space low address page map */
/*--------------------------------------*/ /*--------------------------------------*/
......
...@@ -38,6 +38,8 @@ struct page_zip_des_struct ...@@ -38,6 +38,8 @@ struct page_zip_des_struct
ulint m_end; /* end offset of modification log */ ulint m_end; /* end offset of modification log */
}; };
#define PAGE_ZIP_MIN_SIZE 1024 /* smallest page_zip_des_struct.size */
/************************************************************************** /**************************************************************************
Write data to the compressed page. The data must already be written to Write data to the compressed page. The data must already be written to
the uncompressed page. */ the uncompressed page. */
......
...@@ -396,7 +396,7 @@ mlog_parse_string( ...@@ -396,7 +396,7 @@ mlog_parse_string(
len = mach_read_from_2(ptr); len = mach_read_from_2(ptr);
ptr += 2; ptr += 2;
ut_a(len + offset < UNIV_PAGE_SIZE); ut_a(len + offset <= UNIV_PAGE_SIZE);
if (end_ptr < ptr + len) { if (end_ptr < ptr + len) {
......
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