Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d4901de8
Commit
d4901de8
authored
Jun 28, 2005
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Plain Diff
Merge hundin.mysql.fi:/home/marko/mysql-4.1
into hundin.mysql.fi:/home/marko/mysql-5.0-current
parents
3dd28e98
99efe900
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
40 deletions
+40
-40
innobase/fil/fil0fil.c
innobase/fil/fil0fil.c
+11
-13
innobase/include/os0file.h
innobase/include/os0file.h
+1
-1
innobase/os/os0file.c
innobase/os/os0file.c
+28
-26
No files found.
innobase/fil/fil0fil.c
View file @
d4901de8
...
...
@@ -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
));
...
...
innobase/include/os0file.h
View file @
d4901de8
...
...
@@ -373,7 +373,7 @@ os_file_get_size_as_iblonglong(
/* out: size in bytes, -1 if error */
os_file_t
file
);
/* in: handle to a file */
/***************************************************************************
Sets a file size. This function can be used to extend or truncate a
file. */
Write the specified number of zeros to a newly created
file. */
ibool
os_file_set_size
(
...
...
innobase/os/os0file.c
View file @
d4901de8
...
...
@@ -1653,7 +1653,7 @@ os_file_get_size_as_iblonglong(
}
/***************************************************************************
Sets a file size. This function can be used to extend or truncate a
file. */
Write the specified number of zeros to a newly created
file. */
ibool
os_file_set_size
(
...
...
@@ -1666,44 +1666,46 @@ os_file_set_size(
size */
ulint
size_high
)
/* in: most significant 32 bits of size */
{
ib_longlong
offset
;
ib_longlong
low
;
ulint
n_bytes
;
ib_longlong
current_size
;
ib_longlong
desired_size
;
ibool
ret
;
byte
*
buf
;
byte
*
buf2
;
ulint
buf_size
;
ut_a
(
size
==
(
size
&
0xFFFFFFFF
));
/* We use a very big 8 MB buffer in writing because Linux may be
extremely slow in fsync on 1 MB writes */
current_size
=
0
;
desired_size
=
(
ib_longlong
)
size
+
(((
ib_longlong
)
size_high
)
<<
32
);
buf2
=
ut_malloc
(
UNIV_PAGE_SIZE
*
513
);
/* Write up to 1 megabyte at a time. */
buf_size
=
ut_min
(
64
,
(
ulint
)
(
desired_size
/
UNIV_PAGE_SIZE
))
*
UNIV_PAGE_SIZE
;
buf2
=
ut_malloc
(
buf_size
+
UNIV_PAGE_SIZE
);
/* Align the buffer for possible raw i/o */
buf
=
ut_align
(
buf2
,
UNIV_PAGE_SIZE
);
/* Write buffer full of zeros */
memset
(
buf
,
0
,
UNIV_PAGE_SIZE
*
512
);
memset
(
buf
,
0
,
buf_size
);
offset
=
0
;
low
=
(
ib_longlong
)
size
+
(((
ib_longlong
)
size_high
)
<<
32
);
if
(
low
>=
(
ib_longlong
)(
100
*
1024
*
1024
))
{
if
(
desired_size
>=
(
ib_longlong
)(
100
*
1024
*
1024
))
{
fprintf
(
stderr
,
"InnoDB: Progress in MB:"
);
}
while
(
offset
<
low
)
{
if
(
low
-
offset
<
UNIV_PAGE_SIZE
*
512
)
{
n_bytes
=
(
ulint
)(
low
-
offset
);
}
else
{
n_bytes
=
UNIV_PAGE_SIZE
*
512
;
}
while
(
current_size
<
desired_size
)
{
ulint
n_bytes
;
if
(
desired_size
-
current_size
<
(
ib_longlong
)
buf_size
)
{
n_bytes
=
(
ulint
)
(
desired_size
-
current_size
);
}
else
{
n_bytes
=
buf_size
;
}
ret
=
os_file_write
(
name
,
file
,
buf
,
(
ulint
)(
offset
&
0xFFFFFFFF
),
(
ulint
)(
offset
>>
32
),
(
ulint
)(
current_size
&
0xFFFFFFFF
),
(
ulint
)(
current_size
>>
32
),
n_bytes
);
if
(
!
ret
)
{
ut_free
(
buf2
);
...
...
@@ -1711,18 +1713,18 @@ os_file_set_size(
}
/* Print about progress for each 100 MB written */
if
((
ib_longlong
)
(
offset
+
n_bytes
)
/
(
ib_longlong
)(
100
*
1024
*
1024
)
!=
offset
/
(
ib_longlong
)(
100
*
1024
*
1024
))
{
if
((
current_size
+
n_bytes
)
/
(
ib_longlong
)(
100
*
1024
*
1024
)
!=
current_size
/
(
ib_longlong
)(
100
*
1024
*
1024
))
{
fprintf
(
stderr
,
" %lu00"
,
(
ulong
)
((
offset
+
n_bytes
)
(
ulong
)
((
current_size
+
n_bytes
)
/
(
ib_longlong
)(
100
*
1024
*
1024
)));
}
offset
+=
n_bytes
;
current_size
+=
n_bytes
;
}
if
(
low
>=
(
ib_longlong
)(
100
*
1024
*
1024
))
{
if
(
desired_size
>=
(
ib_longlong
)(
100
*
1024
*
1024
))
{
fprintf
(
stderr
,
"
\n
"
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment