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/xtradb/include | |
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/xtradb/include')
-rw-r--r-- | storage/xtradb/include/buf0buf.h | 2 | ||||
-rw-r--r-- | storage/xtradb/include/fil0fil.h | 10 | ||||
-rw-r--r-- | storage/xtradb/include/os0file.h | 21 | ||||
-rw-r--r-- | storage/xtradb/include/os0file.ic | 10 |
4 files changed, 25 insertions, 18 deletions
diff --git a/storage/xtradb/include/buf0buf.h b/storage/xtradb/include/buf0buf.h index a2097b5c3b9..7eb58216698 100644 --- a/storage/xtradb/include/buf0buf.h +++ b/storage/xtradb/include/buf0buf.h @@ -1598,6 +1598,8 @@ struct buf_page_t{ can be read while it's being flushed */ byte* comp_buf_free; /*!< for compression, allocated buffer that is then alligned */ + bool encrypt_later; /*!< should we encrypt the page + at os0file.cc ? */ #ifndef UNIV_HOTBACKUP buf_page_t* hash; /*!< node used in chaining to buf_pool->page_hash or diff --git a/storage/xtradb/include/fil0fil.h b/storage/xtradb/include/fil0fil.h index 360a26df776..1847a314d06 100644 --- a/storage/xtradb/include/fil0fil.h +++ b/storage/xtradb/include/fil0fil.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2014, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2015, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -340,6 +340,7 @@ struct fil_space_t { UT_LIST_NODE_T(fil_space_t) space_list; /*!< list of all spaces */ fil_space_crypt_t* crypt_data; + ulint file_block_size;/*!< file system block size */ ulint magic_n;/*!< FIL_SPACE_MAGIC_N */ }; @@ -959,8 +960,8 @@ fil_space_get_n_reserved_extents( Reads or writes data. This operation is asynchronous (aio). @return DB_SUCCESS, or DB_TABLESPACE_DELETED if we are trying to do i/o on a tablespace which does not exist */ -#define fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, lsn) \ - _fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, NULL, lsn) +#define fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, lsn, encrypt) \ + _fil_io(type, sync, space_id, zip_size, block_offset, byte_offset, len, buf, message, write_size, NULL, lsn, encrypt) UNIV_INTERN dberr_t @@ -997,7 +998,8 @@ _fil_io( initialized we do not trim again if actual page size does not decrease. */ trx_t* trx, - lsn_t lsn) /* lsn of the newest modification */ + lsn_t lsn, /*!< in: lsn of the newest modification */ + bool encrypt_later) /*!< in: encrypt later ? */ __attribute__((nonnull(8))); /**********************************************************************//** diff --git a/storage/xtradb/include/os0file.h b/storage/xtradb/include/os0file.h index af3ad734f48..f93bf026903 100644 --- a/storage/xtradb/include/os0file.h +++ b/storage/xtradb/include/os0file.h @@ -2,7 +2,7 @@ Copyright (c) 1995, 2013, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2009, Percona Inc. -Copyright (c) 2013, SkySQL Ab. All Rights Reserved. +Copyright (c) 2013, 2015, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Percona Inc.. Those modifications are @@ -324,11 +324,11 @@ The wrapper functions have the prefix of "innodb_". */ # define os_aio(type, mode, name, file, buf, offset, \ n, message1, message2, space_id, \ trx, page_compressed, page_compression_level, write_size, \ - page_encryption, page_encryption_key, lsn) \ + page_encryption, page_encryption_key, lsn, encrypt) \ pfs_os_aio_func(type, mode, name, file, buf, offset, \ n, message1, message2, space_id, trx, \ page_compressed, page_compression_level, write_size, \ - page_encryption, page_encryption_key, lsn, \ + page_encryption, page_encryption_key, lsn, encrypt, \ __FILE__, __LINE__) # define os_file_read(file, buf, offset, n, compressed) \ @@ -378,11 +378,11 @@ to original un-instrumented file I/O APIs */ # define os_aio(type, mode, name, file, buf, offset, n, message1, \ message2, space_id, trx, \ page_compressed, page_compression_level, write_size, \ - page_encryption, page_encryption_key, lsn) \ + page_encryption, page_encryption_key, lsn, encrypt) \ os_aio_func(type, mode, name, file, buf, offset, n, \ message1, message2, space_id, trx, \ page_compressed, page_compression_level, write_size, \ - page_encryption, page_encryption_key, lsn) + page_encryption, page_encryption_key, lsn, encrypt) # define os_file_read(file, buf, offset, n, compressed) \ os_file_read_func(file, buf, offset, n, NULL, compressed) @@ -812,9 +812,10 @@ pfs_os_aio_func( actual page size does not decrease. */ ibool page_encryption, /*!< in: is page encryption used on this file space */ - ulint page_encryption_key, /*!< page encryption + ulint page_encryption_key, /*!< in: page encryption key to be used */ - lsn_t lsn, /* lsn of the newest modification */ + lsn_t lsn, /*!< in: lsn of the newest modification */ + bool encrypt_later, /*!< in: should we encrypt ? */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line);/*!< in: line where the func invoked */ /*******************************************************************//** @@ -1204,10 +1205,10 @@ os_aio_func( actual page size does not decrease. */ ibool page_encryption, /*!< in: is page encryption used on this file space */ - ulint page_encryption_key, /*!< page encryption key + ulint page_encryption_key, /*!< in: page encryption key to be used */ - lsn_t lsn); /* lsn of the newest modification */ - + lsn_t lsn, /*!< in: lsn of the newest modification */ + bool encrypt_later); /*!< in: should we encrypt ? */ /************************************************************************//** Wakes up all async i/o threads so that they know to exit themselves in shutdown. */ diff --git a/storage/xtradb/include/os0file.ic b/storage/xtradb/include/os0file.ic index 9ab191bd460..39599ba2047 100644 --- a/storage/xtradb/include/os0file.ic +++ b/storage/xtradb/include/os0file.ic @@ -222,7 +222,7 @@ pfs_os_aio_func( trx_t* trx, ibool page_compression, /*!< in: is page compression used on this file space */ - ulint page_compression_level, /*!< page compression + ulint page_compression_level, /*!< in: page compression level to be used */ ulint* write_size,/*!< in/out: Actual write size initialized after fist successfull trim @@ -231,10 +231,12 @@ pfs_os_aio_func( actual page size does not decrease. */ ibool page_encryption, /*!< in: is page encryption used on this file space */ - ulint page_encryption_key, /*!< page encryption + ulint page_encryption_key, /*!< in: page encryption key to be used */ - lsn_t lsn, /* lsn of the newest modification */ + lsn_t lsn, /*!< in: lsn of the newest + modification */ + bool encrypt_later, /*!< in: encrypt later ? */ const char* src_file,/*!< in: file name where func invoked */ ulint src_line)/*!< in: line where the func invoked */ { @@ -252,7 +254,7 @@ pfs_os_aio_func( result = os_aio_func(type, mode, name, file, buf, offset, n, message1, message2, space_id, trx, page_compression, page_compression_level, write_size , - page_encryption, page_encryption_key, lsn); + page_encryption, page_encryption_key, lsn, encrypt_later); register_pfs_file_io_end(locker, n); |