summaryrefslogtreecommitdiff
path: root/innobase/fil
diff options
context:
space:
mode:
authorunknown <marko@hundin.mysql.fi>2005-06-28 10:51:01 +0300
committerunknown <marko@hundin.mysql.fi>2005-06-28 10:51:01 +0300
commit26a52bbe9439659d8642decb053663577ee45c18 (patch)
tree95b88a3840c71f96d8887f23c0a42e75cf0cb5c3 /innobase/fil
parentfeffe571eb0044817cee8d53019081a9f1025662 (diff)
parentb608f091dbf628db32e67e9a62f3045f6dcf2ed7 (diff)
downloadmariadb-git-26a52bbe9439659d8642decb053663577ee45c18.tar.gz
Merge hundin.mysql.fi:/home/marko/mysql-4.1
into hundin.mysql.fi:/home/marko/mysql-5.0-current innobase/fil/fil0fil.c: SCCS merged innobase/include/os0file.h: SCCS merged innobase/os/os0file.c: SCCS merged
Diffstat (limited to 'innobase/fil')
-rw-r--r--innobase/fil/fil0fil.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/innobase/fil/fil0fil.c b/innobase/fil/fil0fil.c
index e236304b388..20f522c1a60 100644
--- a/innobase/fil/fil0fil.c
+++ b/innobase/fil/fil0fil.c
@@ -3410,9 +3410,9 @@ fil_extend_space_to_desired_size(
fil_space_t* space;
byte* buf2;
byte* buf;
+ ulint buf_size;
ulint start_page_no;
ulint file_start_page_no;
- ulint n_pages;
ulint offset_high;
ulint offset_low;
ibool success = TRUE;
@@ -3437,22 +3437,20 @@ fil_extend_space_to_desired_size(
fil_node_prepare_for_io(node, system, space);
- /* Extend 1 MB at a time */
-
- buf2 = mem_alloc(1024 * 1024 + UNIV_PAGE_SIZE);
- buf = ut_align(buf2, UNIV_PAGE_SIZE);
-
- memset(buf, '\0', 1024 * 1024);
-
start_page_no = space->size;
file_start_page_no = space->size - node->size;
- while (start_page_no < size_after_extend) {
- n_pages = size_after_extend - start_page_no;
+ /* Extend at most 64 pages at a time */
+ buf_size = ut_min(64, size_after_extend - start_page_no)
+ * UNIV_PAGE_SIZE;
+ buf2 = mem_alloc(buf_size + UNIV_PAGE_SIZE);
+ buf = ut_align(buf2, UNIV_PAGE_SIZE);
- if (n_pages > (1024 * 1024) / UNIV_PAGE_SIZE) {
- n_pages = (1024 * 1024) / UNIV_PAGE_SIZE;
- }
+ memset(buf, 0, buf_size);
+
+ while (start_page_no < size_after_extend) {
+ ulint n_pages = ut_min(buf_size / UNIV_PAGE_SIZE,
+ size_after_extend - start_page_no);
offset_high = (start_page_no - file_start_page_no)
/ (4096 * ((1024 * 1024) / UNIV_PAGE_SIZE));