Move page initialization to better place.
This commit is contained in:
parent
316d8c7fc8
commit
24a6b41348
@ -461,9 +461,6 @@ fil_compress_page(
|
|||||||
ut_a(block_size > 0);
|
ut_a(block_size > 0);
|
||||||
#endif
|
#endif
|
||||||
write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size);
|
write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size);
|
||||||
/* Initialize rest of the written data to avoid
|
|
||||||
uninitialized bytes */
|
|
||||||
memset(out_buf+tmp, 0, write_size-tmp);
|
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
ut_a(write_size > 0 && ((write_size % block_size) == 0));
|
ut_a(write_size > 0 && ((write_size % block_size) == 0));
|
||||||
ut_a(write_size >= tmp);
|
ut_a(write_size >= tmp);
|
||||||
@ -480,13 +477,6 @@ fil_compress_page(
|
|||||||
srv_stats.page_compression_saved.add((len - write_size));
|
srv_stats.page_compression_saved.add((len - write_size));
|
||||||
srv_stats.pages_page_compressed.inc();
|
srv_stats.pages_page_compressed.inc();
|
||||||
|
|
||||||
if (!srv_use_trim) {
|
|
||||||
/* If persistent trims are not used we always write full
|
|
||||||
page and end of the page needs to be initialized.*/
|
|
||||||
memset(out_buf+write_size, 0, len-write_size);
|
|
||||||
write_size = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_len = write_size;
|
*out_len = write_size;
|
||||||
|
|
||||||
return(out_buf);
|
return(out_buf);
|
||||||
|
@ -458,9 +458,6 @@ fil_compress_page(
|
|||||||
ut_a(block_size > 0);
|
ut_a(block_size > 0);
|
||||||
#endif
|
#endif
|
||||||
write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size);
|
write_size = (size_t)ut_uint64_align_up((ib_uint64_t)write_size, block_size);
|
||||||
/* Initialize rest of the written data to avoid
|
|
||||||
uninitialized bytes */
|
|
||||||
memset(out_buf+tmp, 0, write_size-tmp);
|
|
||||||
#ifdef UNIV_DEBUG
|
#ifdef UNIV_DEBUG
|
||||||
ut_a(write_size > 0 && ((write_size % block_size) == 0));
|
ut_a(write_size > 0 && ((write_size % block_size) == 0));
|
||||||
ut_a(write_size >= tmp);
|
ut_a(write_size >= tmp);
|
||||||
@ -477,13 +474,6 @@ fil_compress_page(
|
|||||||
srv_stats.page_compression_saved.add((len - write_size));
|
srv_stats.page_compression_saved.add((len - write_size));
|
||||||
srv_stats.pages_page_compressed.inc();
|
srv_stats.pages_page_compressed.inc();
|
||||||
|
|
||||||
if (!srv_use_trim) {
|
|
||||||
/* If persistent trims are not used we always write full
|
|
||||||
page and end of the page needs to be initialized.*/
|
|
||||||
memset(out_buf+write_size, 0, len-write_size);
|
|
||||||
write_size = len;
|
|
||||||
}
|
|
||||||
|
|
||||||
*out_len = write_size;
|
*out_len = write_size;
|
||||||
|
|
||||||
return(out_buf);
|
return(out_buf);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user