diff options
author | Jan Lindström <jan.lindstrom@skysql.com> | 2015-01-09 12:30:59 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2015-02-10 10:21:18 +0100 |
commit | e2e809860e8a1ad6a4d82859558cfd89409ac6d4 (patch) | |
tree | 2b300109a168ec882f89aee88aa09bd588c0176d /storage/innobase/buf/buf0dblwr.cc | |
parent | e109a662c77ec8f6db42c940d6c82c00d2f9f5d9 (diff) | |
download | mariadb-git-e2e809860e8a1ad6a4d82859558cfd89409ac6d4.tar.gz |
Pass down the information should we encrypt the page at os0file.cc
when page compression and google encryption is used.
Diffstat (limited to 'storage/innobase/buf/buf0dblwr.cc')
-rw-r--r-- | storage/innobase/buf/buf0dblwr.cc | 123 |
1 files changed, 86 insertions, 37 deletions
diff --git a/storage/innobase/buf/buf0dblwr.cc b/storage/innobase/buf/buf0dblwr.cc index 37b8152f1fa..477bcfe0ee3 100644 --- a/storage/innobase/buf/buf0dblwr.cc +++ b/storage/innobase/buf/buf0dblwr.cc @@ -521,10 +521,18 @@ buf_dblwr_process() ulint zip_size = fil_space_get_zip_size(space_id); /* Read in the actual page from the file */ - fil_io(OS_FILE_READ, true, space_id, zip_size, - page_no, 0, - zip_size ? zip_size : UNIV_PAGE_SIZE, - read_buf, NULL, 0, 0); + fil_io(OS_FILE_READ, + true, + space_id, + zip_size, + page_no, + 0, + zip_size ? zip_size : UNIV_PAGE_SIZE, + read_buf, + NULL, + 0, + 0, + false); if (fil_space_verify_crypt_checksum(read_buf, zip_size)) { /* page is encrypted and checksum is OK */ @@ -576,10 +584,18 @@ buf_dblwr_process() doublewrite buffer to the intended position */ - fil_io(OS_FILE_WRITE, true, space_id, - zip_size, page_no, 0, - zip_size ? zip_size : UNIV_PAGE_SIZE, - page, NULL, 0, 0); + fil_io(OS_FILE_WRITE, + true, + space_id, + zip_size, + page_no, + 0, + zip_size ? zip_size : UNIV_PAGE_SIZE, + page, + NULL, + 0, + 0, + false); ib_logf(IB_LOG_LEVEL_INFO, "Recovered the page from" @@ -595,11 +611,18 @@ buf_dblwr_process() zeroes, while a valid copy is available in dblwr buffer. */ - fil_io(OS_FILE_WRITE, true, space_id, - zip_size, page_no, 0, - zip_size ? zip_size - : UNIV_PAGE_SIZE, - page, NULL, 0, 0); + fil_io(OS_FILE_WRITE, + true, + space_id, + zip_size, + page_no, + 0, + zip_size ? zip_size : UNIV_PAGE_SIZE, + page, + NULL, + 0, + 0, + false); } } } @@ -621,9 +644,9 @@ buf_dblwr_process() memset(buf, 0, bytes); fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, - buf_dblwr->block1, 0, bytes, buf, NULL, NULL, 0); + buf_dblwr->block1, 0, bytes, buf, NULL, NULL, 0, false); fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, - buf_dblwr->block2, 0, bytes, buf, NULL, NULL, 0); + buf_dblwr->block2, 0, bytes, buf, NULL, NULL, 0, false); ut_free(unaligned_buf); } @@ -828,12 +851,18 @@ buf_dblwr_write_block_to_datafile( void * frame = buf_page_get_frame(bpage); if (bpage->zip.data) { - fil_io(flags, sync, buf_page_get_space(bpage), - buf_page_get_zip_size(bpage), - buf_page_get_page_no(bpage), 0, - buf_page_get_zip_size(bpage), - frame, - (void*) bpage, 0, bpage->newest_modification); + fil_io(flags, + sync, + buf_page_get_space(bpage), + buf_page_get_zip_size(bpage), + buf_page_get_page_no(bpage), + 0, + buf_page_get_zip_size(bpage), + frame, + (void*) bpage, + 0, + bpage->newest_modification, + bpage->encrypt_later); return; } @@ -843,12 +872,18 @@ buf_dblwr_write_block_to_datafile( ut_a(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE); buf_dblwr_check_page_lsn(block->frame); - fprintf(stderr, "JAN: space %lu page_type %lu\n", buf_block_get_space(block), - mach_read_from_2((byte *)frame+FIL_PAGE_TYPE)); - - fil_io(flags, sync, buf_block_get_space(block), 0, - buf_block_get_page_no(block), 0, UNIV_PAGE_SIZE, - frame, (void*) block, (ulint *)&bpage->write_size, bpage->newest_modification ); + fil_io(flags, + sync, + buf_block_get_space(block), + 0, + buf_block_get_page_no(block), + 0, + UNIV_PAGE_SIZE, + frame, + (void*) block, + (ulint *)&bpage->write_size, + bpage->newest_modification, + bpage->encrypt_later); } /********************************************************************//** @@ -942,7 +977,7 @@ try_again: fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, buf_dblwr->block1, 0, len, - (void*) write_buf, NULL, 0, 0); + (void*) write_buf, NULL, 0, 0, false); if (buf_dblwr->first_free <= TRX_SYS_DOUBLEWRITE_BLOCK_SIZE) { /* No unwritten pages in the second block. */ @@ -958,7 +993,7 @@ try_again: fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, buf_dblwr->block2, 0, len, - (void*) write_buf, NULL, 0, 0); + (void*) write_buf, NULL, 0, 0, false); flush: /* increment the doublewrite flushed pages counter */ @@ -1187,17 +1222,31 @@ retry: memset(buf_dblwr->write_buf + UNIV_PAGE_SIZE * i + zip_size, 0, UNIV_PAGE_SIZE - zip_size); - fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, - offset, 0, UNIV_PAGE_SIZE, - (void*) (buf_dblwr->write_buf - + UNIV_PAGE_SIZE * i), NULL, 0, bpage->newest_modification); + fil_io(OS_FILE_WRITE, + true, + TRX_SYS_SPACE, 0, + offset, + 0, + UNIV_PAGE_SIZE, + (void*) (buf_dblwr->write_buf + UNIV_PAGE_SIZE * i), + NULL, + 0, + bpage->newest_modification, + bpage->encrypt_later); } else { /* It is a regular page. Write it directly to the doublewrite buffer */ - fil_io(OS_FILE_WRITE, true, TRX_SYS_SPACE, 0, - offset, 0, UNIV_PAGE_SIZE, - frame, - NULL, 0, bpage->newest_modification); + fil_io(OS_FILE_WRITE, + true, + TRX_SYS_SPACE, 0, + offset, + 0, + UNIV_PAGE_SIZE, + frame, + NULL, + 0, + bpage->newest_modification, + bpage->encrypt_later); } /* Now flush the doublewrite buffer data to disk */ |