diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-16 08:41:56 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2022-03-16 08:41:56 +0200 |
commit | 00b88376e1d2741fe9c3b250e1b28e7d7f09efd2 (patch) | |
tree | 718774fd1ba7d1c06a169d9c941a07d9b265455d | |
parent | 1ecf173741a83ba9c252372651871565cf482442 (diff) | |
download | mariadb-git-00b88376e1d2741fe9c3b250e1b28e7d7f09efd2.tar.gz |
MDEV-27812 fixup: Use log_sys.get_block_size()
The data member log_sys.block_size is only defined in environments
where we can determine the physical block size of a file
(currently, Linux and Microsoft Windows). The accessor function
get_block_size() is available everywhere.
Thanks to Dmitry Shulga for reporting the build failure.
-rw-r--r-- | storage/innobase/log/log0log.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index f6fd75d93d0..64113301ad4 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -460,7 +460,7 @@ log_t::resize_start_status log_t::resize_start(os_offset_t size) noexcept { memcpy_aligned<16>(resize_buf, buf, (buf_free + 15) & ~15); start_lsn= first_lsn + - (~lsn_t{block_size - 1} & (write_lsn - first_lsn)); + (~lsn_t{get_block_size() - 1} & (write_lsn - first_lsn)); } } resize_lsn.store(start_lsn, std::memory_order_relaxed); @@ -713,21 +713,22 @@ inline void log_t::persist(lsn_t lsn) noexcept @param length the used length of resize_buf */ ATTRIBUTE_COLD void log_t::resize_write_buf(size_t length) noexcept { - ut_ad(!(resize_target & (block_size - 1))); - ut_ad(!(length & (block_size - 1))); - ut_ad(length >= block_size); + const size_t block_size_1= get_block_size() - 1; + ut_ad(!(resize_target & block_size_1)); + ut_ad(!(length & block_size_1)); + ut_ad(length > block_size_1); ut_ad(length <= resize_target); const lsn_t resizing{resize_in_progress()}; ut_ad(resizing <= write_lsn); lsn_t offset= START_OFFSET + - ((write_lsn - resizing) & ~lsn_t{block_size - 1}) % + ((write_lsn - resizing) & ~lsn_t{block_size_1}) % (resize_target - START_OFFSET); if (UNIV_UNLIKELY(offset + length > resize_target)) { offset= START_OFFSET; resize_lsn.store(first_lsn + - (~lsn_t{block_size - 1} & (write_lsn - first_lsn)), + (~lsn_t{block_size_1} & (write_lsn - first_lsn)), std::memory_order_relaxed); } |