Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
72d01f24
Commit
72d01f24
authored
Jun 02, 2015
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove few #ifdefs in innodb/xtradb
parent
5fc53b7c
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
50 deletions
+6
-50
storage/innobase/buf/buf0buf.cc
storage/innobase/buf/buf0buf.cc
+1
-23
storage/innobase/include/fil0fil.ic
storage/innobase/include/fil0fil.ic
+2
-2
storage/xtradb/buf/buf0buf.cc
storage/xtradb/buf/buf0buf.cc
+1
-23
storage/xtradb/include/fil0fil.ic
storage/xtradb/include/fil0fil.ic
+2
-2
No files found.
storage/innobase/buf/buf0buf.cc
View file @
72d01f24
...
@@ -5708,9 +5708,7 @@ buf_page_encrypt_before_write(
...
@@ -5708,9 +5708,7 @@ buf_page_encrypt_before_write(
fil_space_crypt_t
*
crypt_data
=
fil_space_get_crypt_data
(
space_id
);
fil_space_crypt_t
*
crypt_data
=
fil_space_get_crypt_data
(
space_id
);
bpage
->
real_size
=
UNIV_PAGE_SIZE
;
bpage
->
real_size
=
UNIV_PAGE_SIZE
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
src_frame
);
fil_page_type_validate
(
src_frame
);
#endif
if
(
crypt_data
!=
NULL
&&
crypt_data
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
if
(
crypt_data
!=
NULL
&&
crypt_data
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
/* Encryption is disabled */
/* Encryption is disabled */
...
@@ -5767,9 +5765,7 @@ buf_page_encrypt_before_write(
...
@@ -5767,9 +5765,7 @@ buf_page_encrypt_before_write(
bpage
->
key_version
=
key_version
;
bpage
->
key_version
=
key_version
;
bpage
->
real_size
=
page_size
;
bpage
->
real_size
=
page_size
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
}
else
{
}
else
{
/* First we compress the page content */
/* First we compress the page content */
...
@@ -5783,18 +5779,12 @@ buf_page_encrypt_before_write(
...
@@ -5783,18 +5779,12 @@ buf_page_encrypt_before_write(
fil_space_get_page_compression_level
(
bpage
->
space
),
fil_space_get_page_compression_level
(
bpage
->
space
),
block_size
,
block_size
,
&
out_len
,
&
out_len
,
#ifdef HAVE_LZO
IF_LZO
(
slot
->
lzo_mem
,
NULL
)
slot
->
lzo_mem
#else
NULL
#endif
);
);
bpage
->
real_size
=
out_len
;
bpage
->
real_size
=
out_len
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
tmp
);
fil_page_type_validate
(
tmp
);
#endif
/* And then we encrypt the page content */
/* And then we encrypt the page content */
fil_space_encrypt
(
bpage
->
space
,
fil_space_encrypt
(
bpage
->
space
,
...
@@ -5805,9 +5795,7 @@ buf_page_encrypt_before_write(
...
@@ -5805,9 +5795,7 @@ buf_page_encrypt_before_write(
dst_frame
);
dst_frame
);
}
}
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
// return dst_frame which will be written
// return dst_frame which will be written
return
dst_frame
;
return
dst_frame
;
...
@@ -5847,9 +5835,7 @@ buf_page_decrypt_after_read(
...
@@ -5847,9 +5835,7 @@ buf_page_decrypt_after_read(
/* Find free slot from temporary memory array */
/* Find free slot from temporary memory array */
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
fil_decompress_page
(
slot
->
comp_buf
,
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
dst_frame
,
...
@@ -5860,9 +5846,7 @@ buf_page_decrypt_after_read(
...
@@ -5860,9 +5846,7 @@ buf_page_decrypt_after_read(
slot
->
reserved
=
false
;
slot
->
reserved
=
false
;
}
}
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
}
else
{
}
else
{
/* the page we read is encrypted */
/* the page we read is encrypted */
/* Find free slot from temporary memory array */
/* Find free slot from temporary memory array */
...
@@ -5870,10 +5854,8 @@ buf_page_decrypt_after_read(
...
@@ -5870,10 +5854,8 @@ buf_page_decrypt_after_read(
memcpy
(
slot
->
crypt_buf
,
dst_frame
,
size
);
memcpy
(
slot
->
crypt_buf
,
dst_frame
,
size
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
slot
->
crypt_buf
);
fil_page_type_validate
(
slot
->
crypt_buf
);
#endif
/* decrypt from crypt_buf to dst_frame */
/* decrypt from crypt_buf to dst_frame */
fil_space_decrypt
(
bpage
->
space
,
fil_space_decrypt
(
bpage
->
space
,
...
@@ -5881,10 +5863,8 @@ buf_page_decrypt_after_read(
...
@@ -5881,10 +5863,8 @@ buf_page_decrypt_after_read(
size
,
size
,
dst_frame
);
dst_frame
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
slot
->
crypt_buf
);
fil_page_type_validate
(
slot
->
crypt_buf
);
#endif
/* decompress from dst_frame to comp_buf and then copy to
/* decompress from dst_frame to comp_buf and then copy to
buffer pool */
buffer pool */
...
@@ -5895,9 +5875,7 @@ buf_page_decrypt_after_read(
...
@@ -5895,9 +5875,7 @@ buf_page_decrypt_after_read(
&
bpage
->
write_size
);
&
bpage
->
write_size
);
}
}
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
/* Mark this slot as free */
/* Mark this slot as free */
slot
->
reserved
=
false
;
slot
->
reserved
=
false
;
...
...
storage/innobase/include/fil0fil.ic
View file @
72d01f24
...
@@ -105,7 +105,6 @@ fil_node_get_block_size(
...
@@ -105,7 +105,6 @@ fil_node_get_block_size(
return (node->file_block_size);
return (node->file_block_size);
}
}
#ifdef UNIV_DEBUG
/****************************************************************//**
/****************************************************************//**
Validate page type.
Validate page type.
@return true if valid, false if not */
@return true if valid, false if not */
...
@@ -114,6 +113,7 @@ bool
...
@@ -114,6 +113,7 @@ bool
fil_page_type_validate(
fil_page_type_validate(
const byte* page) /*!< in: page */
const byte* page) /*!< in: page */
{
{
#ifdef UNIV_DEBUG
ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
#ifdef UNIV_ENCRYPTION_EXTRA_DEBUG
#ifdef UNIV_ENCRYPTION_EXTRA_DEBUG
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
...
@@ -167,8 +167,8 @@ fil_page_type_validate(
...
@@ -167,8 +167,8 @@ fil_page_type_validate(
return false;
return false;
}
}
#endif /* UNIV_DEBUG */
return true;
return true;
}
}
#endif /* UNIV_DEBUG */
#endif /* fil0fil_ic */
#endif /* fil0fil_ic */
storage/xtradb/buf/buf0buf.cc
View file @
72d01f24
...
@@ -5867,9 +5867,7 @@ buf_page_encrypt_before_write(
...
@@ -5867,9 +5867,7 @@ buf_page_encrypt_before_write(
fil_space_crypt_t
*
crypt_data
=
fil_space_get_crypt_data
(
space_id
);
fil_space_crypt_t
*
crypt_data
=
fil_space_get_crypt_data
(
space_id
);
bpage
->
real_size
=
UNIV_PAGE_SIZE
;
bpage
->
real_size
=
UNIV_PAGE_SIZE
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
src_frame
);
fil_page_type_validate
(
src_frame
);
#endif
if
(
crypt_data
!=
NULL
&&
crypt_data
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
if
(
crypt_data
!=
NULL
&&
crypt_data
->
encryption
==
FIL_SPACE_ENCRYPTION_OFF
)
{
/* Encryption is disabled */
/* Encryption is disabled */
...
@@ -5926,9 +5924,7 @@ buf_page_encrypt_before_write(
...
@@ -5926,9 +5924,7 @@ buf_page_encrypt_before_write(
bpage
->
key_version
=
key_version
;
bpage
->
key_version
=
key_version
;
bpage
->
real_size
=
page_size
;
bpage
->
real_size
=
page_size
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
}
else
{
}
else
{
/* First we compress the page content */
/* First we compress the page content */
...
@@ -5942,18 +5938,12 @@ buf_page_encrypt_before_write(
...
@@ -5942,18 +5938,12 @@ buf_page_encrypt_before_write(
fil_space_get_page_compression_level
(
bpage
->
space
),
fil_space_get_page_compression_level
(
bpage
->
space
),
block_size
,
block_size
,
&
out_len
,
&
out_len
,
#ifdef HAVE_LZO
IF_LZO
(
slot
->
lzo_mem
,
NULL
)
slot
->
lzo_mem
#else
NULL
#endif
);
);
bpage
->
real_size
=
out_len
;
bpage
->
real_size
=
out_len
;
#ifdef UNIV_DEBUG
fil_page_type_validate
(
tmp
);
fil_page_type_validate
(
tmp
);
#endif
/* And then we encrypt the page content */
/* And then we encrypt the page content */
fil_space_encrypt
(
bpage
->
space
,
fil_space_encrypt
(
bpage
->
space
,
...
@@ -5964,9 +5954,7 @@ buf_page_encrypt_before_write(
...
@@ -5964,9 +5954,7 @@ buf_page_encrypt_before_write(
dst_frame
);
dst_frame
);
}
}
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
// return dst_frame which will be written
// return dst_frame which will be written
return
dst_frame
;
return
dst_frame
;
...
@@ -6003,9 +5991,7 @@ buf_page_decrypt_after_read(
...
@@ -6003,9 +5991,7 @@ buf_page_decrypt_after_read(
/* Find free slot from temporary memory array */
/* Find free slot from temporary memory array */
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
fil_decompress_page
(
slot
->
comp_buf
,
fil_decompress_page
(
slot
->
comp_buf
,
dst_frame
,
dst_frame
,
...
@@ -6016,18 +6002,14 @@ buf_page_decrypt_after_read(
...
@@ -6016,18 +6002,14 @@ buf_page_decrypt_after_read(
slot
->
reserved
=
false
;
slot
->
reserved
=
false
;
}
}
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
}
else
{
}
else
{
/* Find free slot from temporary memory array */
/* Find free slot from temporary memory array */
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
buf_tmp_buffer_t
*
slot
=
buf_pool_reserve_tmp_slot
(
buf_pool
,
page_compressed
);
memcpy
(
slot
->
crypt_buf
,
dst_frame
,
size
);
memcpy
(
slot
->
crypt_buf
,
dst_frame
,
size
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
slot
->
crypt_buf
);
fil_page_type_validate
(
slot
->
crypt_buf
);
#endif
/* decrypt from crypt_buf to dst_frame */
/* decrypt from crypt_buf to dst_frame */
fil_space_decrypt
(
bpage
->
space
,
fil_space_decrypt
(
bpage
->
space
,
...
@@ -6035,10 +6017,8 @@ buf_page_decrypt_after_read(
...
@@ -6035,10 +6017,8 @@ buf_page_decrypt_after_read(
size
,
size
,
dst_frame
);
dst_frame
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
slot
->
crypt_buf
);
fil_page_type_validate
(
slot
->
crypt_buf
);
#endif
if
(
page_compressed
)
{
if
(
page_compressed
)
{
fil_decompress_page
(
slot
->
comp_buf
,
fil_decompress_page
(
slot
->
comp_buf
,
...
@@ -6046,9 +6026,7 @@ buf_page_decrypt_after_read(
...
@@ -6046,9 +6026,7 @@ buf_page_decrypt_after_read(
size
,
size
,
&
bpage
->
write_size
);
&
bpage
->
write_size
);
#ifdef UNIV_DEBUG
fil_page_type_validate
(
dst_frame
);
fil_page_type_validate
(
dst_frame
);
#endif
}
}
/* Mark this slot as free */
/* Mark this slot as free */
...
...
storage/xtradb/include/fil0fil.ic
View file @
72d01f24
...
@@ -105,7 +105,6 @@ fil_node_get_block_size(
...
@@ -105,7 +105,6 @@ fil_node_get_block_size(
return (node->file_block_size);
return (node->file_block_size);
}
}
#ifdef UNIV_DEBUG
/****************************************************************//**
/****************************************************************//**
Validate page type.
Validate page type.
@return true if valid, false if not */
@return true if valid, false if not */
...
@@ -114,6 +113,7 @@ bool
...
@@ -114,6 +113,7 @@ bool
fil_page_type_validate(
fil_page_type_validate(
const byte* page) /*!< in: page */
const byte* page) /*!< in: page */
{
{
#ifdef UNIV_DEBUG
ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
ulint page_type = mach_read_from_2(page + FIL_PAGE_TYPE);
#ifdef UNIV_ENCRYPTION_EXTRA_DEBUG
#ifdef UNIV_ENCRYPTION_EXTRA_DEBUG
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
uint key_version = mach_read_from_4(page + FIL_PAGE_FILE_FLUSH_LSN_OR_KEY_VERSION);
...
@@ -168,8 +168,8 @@ fil_page_type_validate(
...
@@ -168,8 +168,8 @@ fil_page_type_validate(
return false;
return false;
}
}
#endif /* UNIV_DEBUG */
return true;
return true;
}
}
#endif /* UNIV_DEBUG */
#endif /* fil0fil_ic */
#endif /* fil0fil_ic */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment