InnoDB/XtraDB Encryption cleanup.

Step 1:
-- Remove page encryption from dictionary (per table
encryption will be handled by storing crypt_data to page 0)
-- Remove encryption/compression from os0file and all functions
before that (compression will be added to buf0buf.cc)
-- Use same CRYPT_SCHEME_1 for all encryption methods
-- Do some code cleanups to confort InnoDB coding style
This commit is contained in:
Jan Lindström 2015-04-01 11:50:21 +03:00 committed by Sergei Golubchik
commit b4a4d82396
64 changed files with 2450 additions and 3957 deletions

View file

@ -312,25 +312,21 @@ The wrapper functions have the prefix of "innodb_". */
pfs_os_file_close_func(file, __FILE__, __LINE__)
# define os_aio(type, mode, name, file, buf, offset, \
n, message1, message2, write_size, \
page_compression, page_compression_level, \
page_encryption, page_encryption_key, lsn, encrypt) \
n, message1, message2, write_size) \
pfs_os_aio_func(type, mode, name, file, buf, offset, \
n, message1, message2, write_size, \
page_compression, page_compression_level, \
page_encryption, page_encryption_key, \
lsn, encrypt, __FILE__, __LINE__)
__FILE__, __LINE__)
# define os_file_read(file, buf, offset, n, compressed) \
pfs_os_file_read_func(file, buf, offset, n, compressed, __FILE__, __LINE__)
# define os_file_read(file, buf, offset, n) \
pfs_os_file_read_func(file, buf, offset, n, __FILE__, __LINE__)
# define os_file_read_no_error_handling(file, buf, offset, n, compressed) \
# define os_file_read_no_error_handling(file, buf, offset, n) \
pfs_os_file_read_no_error_handling_func(file, buf, offset, n, \
compressed, __FILE__, __LINE__)
__FILE__, __LINE__)
# define os_file_write(name, file, buf, offset, n) \
pfs_os_file_write_func(name, file, buf, offset, \
# define os_file_write(name, file, buf, offset, n) \
pfs_os_file_write_func(name, file, buf, offset, \
n, __FILE__, __LINE__)
# define os_file_flush(file) \
@ -362,18 +358,15 @@ to original un-instrumented file I/O APIs */
# define os_file_close(file) os_file_close_func(file)
# define os_aio(type, mode, name, file, buf, offset, n, message1, \
message2, write_size, page_compression, page_compression_level, \
page_encryption, page_encryption_key, lsn, encrypt) \
message2, write_size) \
os_aio_func(type, mode, name, file, buf, offset, n, \
message1, message2, write_size, \
page_compression, page_compression_level, \
page_encryption, page_encryption_key, lsn, encrypt)
message1, message2, write_size)
# define os_file_read(file, buf, offset, n, compressed) \
os_file_read_func(file, buf, offset, n, compressed)
# define os_file_read(file, buf, offset, n) \
os_file_read_func(file, buf, offset, n)
# define os_file_read_no_error_handling(file, buf, offset, n, compressed) \
os_file_read_no_error_handling_func(file, buf, offset, n, compressed)
# define os_file_read_no_error_handling(file, buf, offset, n) \
os_file_read_no_error_handling_func(file, buf, offset, n)
# define os_file_write(name, file, buf, offset, n) \
os_file_write_func(name, file, buf, offset, n)
@ -724,8 +717,6 @@ pfs_os_file_read_func(
void* buf, /*!< in: buffer where to read */
os_offset_t offset, /*!< in: file offset where to read */
ulint n, /*!< in: number of bytes to read */
ibool compressed, /*!< in: is this file space
compressed ? */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line);/*!< in: line where the func invoked */
@ -744,8 +735,6 @@ pfs_os_file_read_no_error_handling_func(
void* buf, /*!< in: buffer where to read */
os_offset_t offset, /*!< in: file offset where to read */
ulint n, /*!< in: number of bytes to read */
ibool compressed, /*!< in: is this file space
compressed ? */
const char* src_file,/*!< in: file name where func invoked */
ulint src_line);/*!< in: line where the func invoked */
@ -781,16 +770,6 @@ pfs_os_aio_func(
operation for this page and if
initialized we do not trim again if
actual page size does not decrease. */
ibool page_compression, /*!< in: is page compression used
on this file space */
ulint page_compression_level, /*!< page compression
level to be used */
ibool page_encryption, /*!< in: is page encryption used
on this file space */
ulint page_encryption_key, /*!< in: page encryption
key to be used */
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 */
/*******************************************************************//**
@ -947,9 +926,7 @@ os_file_read_func(
os_file_t file, /*!< in: handle to a file */
void* buf, /*!< in: buffer where to read */
os_offset_t offset, /*!< in: file offset where to read */
ulint n, /*!< in: number of bytes to read */
ibool compressed); /*!< in: is this file space
compressed ? */
ulint n); /*!< in: number of bytes to read */
/*******************************************************************//**
Rewind file to its start, read at most size - 1 bytes from it to str, and
NUL-terminate str. All errors are silently ignored. This function is
@ -974,9 +951,7 @@ os_file_read_no_error_handling_func(
os_file_t file, /*!< in: handle to a file */
void* buf, /*!< in: buffer where to read */
os_offset_t offset, /*!< in: file offset where to read */
ulint n, /*!< in: number of bytes to read */
ibool compressed); /*!< in: is this file space
compressed ? */
ulint n); /*!< in: number of bytes to read */
/*******************************************************************//**
NOTE! Use the corresponding macro os_file_write(), not directly this
@ -1160,21 +1135,11 @@ os_aio_func(
(can be used to identify a completed
aio operation); ignored if mode is
OS_AIO_SYNC */
ulint* write_size,/*!< in/out: Actual write size initialized
ulint* write_size);/*!< in/out: Actual write size initialized
after fist successfull trim
operation for this page and if
initialized we do not trim again if
actual page size does not decrease. */
ibool page_compression, /*!< in: is page compression used
on this file space */
ulint page_compression_level, /*!< page compression
level to be used */
ibool page_encryption, /*!< in: is page encryption used
on this file space */
ulint page_encryption_key, /*!< in: page encryption key
to be used */
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. */