diff options
author | unknown <heikki@hundin.mysql.fi> | 2002-07-19 08:33:52 +0300 |
---|---|---|
committer | unknown <heikki@hundin.mysql.fi> | 2002-07-19 08:33:52 +0300 |
commit | d0b58e312976c50c0b6859a2a657f4a9f79ee5e7 (patch) | |
tree | 9fe9d36bbe9bfe674aec5e9cb49ff7b94beb7d54 /innobase | |
parent | 076bdd6cc33aa2d9f5c100540fa50cb3b1ff288d (diff) | |
download | mariadb-git-d0b58e312976c50c0b6859a2a657f4a9f79ee5e7.tar.gz |
os0file.c:
Align the buffer used in initing a data file to zero; this may be needed if the data file is actually a raw device
innobase/os/os0file.c:
Align the buffer used in initing a data file to zero; this may be needed if the data file is actually a raw device
Diffstat (limited to 'innobase')
-rw-r--r-- | innobase/os/os0file.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/innobase/os/os0file.c b/innobase/os/os0file.c index 34e13b80c58..94908ae9ade 100644 --- a/innobase/os/os0file.c +++ b/innobase/os/os0file.c @@ -690,6 +690,7 @@ os_file_set_size( ulint n_bytes; ibool ret; byte* buf; + byte* buf2; ulint i; ut_a(size == (size & 0xFFFFFFFF)); @@ -697,7 +698,10 @@ os_file_set_size( /* We use a very big 8 MB buffer in writing because Linux may be extremely slow in fsync on 1 MB writes */ - buf = ut_malloc(UNIV_PAGE_SIZE * 512); + buf2 = ut_malloc(UNIV_PAGE_SIZE * 513); + + /* Align the buffer for possible raw i/o */ + buf = ut_align(buf2, UNIV_PAGE_SIZE); /* Write buffer full of zeros */ for (i = 0; i < UNIV_PAGE_SIZE * 512; i++) { @@ -725,7 +729,7 @@ os_file_set_size( offset += n_bytes; } - ut_free(buf); + ut_free(buf2); ret = os_file_flush(file); |