Commit 2b660fb4 authored by Marko Mäkelä's avatar Marko Mäkelä

mtr_t::is_block_dirtied(): Define inline

parent a94638f1
...@@ -550,7 +550,7 @@ struct mtr_t { ...@@ -550,7 +550,7 @@ struct mtr_t {
/** Check if this mini-transaction is dirtying a clean page. /** Check if this mini-transaction is dirtying a clean page.
@param block block being x-fixed @param block block being x-fixed
@return true if the mtr is dirtying a clean page. */ @return true if the mtr is dirtying a clean page. */
static bool is_block_dirtied(const buf_block_t* block) static inline bool is_block_dirtied(const buf_block_t* block)
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));
private: private:
......
/***************************************************************************** /*****************************************************************************
Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1995, 2014, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation. Copyright (c) 2017, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under 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 the terms of the GNU General Public License as published by the Free Software
...@@ -26,6 +26,20 @@ Created 11/26/1995 Heikki Tuuri ...@@ -26,6 +26,20 @@ Created 11/26/1995 Heikki Tuuri
#include "buf0buf.h" #include "buf0buf.h"
/** Check if a mini-transaction is dirtying a clean page.
@return true if the mtr is dirtying a clean page. */
bool
mtr_t::is_block_dirtied(const buf_block_t* block)
{
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
ut_ad(block->page.buf_fix_count > 0);
/* It is OK to read oldest_modification because no
other thread can be performing a write of it and it
is only during write that the value is reset to 0. */
return(block->page.oldest_modification == 0);
}
/** /**
Pushes an object to an mtr memo stack. */ Pushes an object to an mtr memo stack. */
void void
......
...@@ -457,20 +457,6 @@ class mtr_t::Command { ...@@ -457,20 +457,6 @@ class mtr_t::Command {
lsn_t m_end_lsn; lsn_t m_end_lsn;
}; };
/** Check if a mini-transaction is dirtying a clean page.
@return true if the mtr is dirtying a clean page. */
bool
mtr_t::is_block_dirtied(const buf_block_t* block)
{
ut_ad(buf_block_get_state(block) == BUF_BLOCK_FILE_PAGE);
ut_ad(block->page.buf_fix_count > 0);
/* It is OK to read oldest_modification because no
other thread can be performing a write of it and it
is only during write that the value is reset to 0. */
return(block->page.oldest_modification == 0);
}
/** Write the block contents to the REDO log */ /** Write the block contents to the REDO log */
struct mtr_write_log_t { struct mtr_write_log_t {
/** Append a block to the redo log buffer. /** Append a block to the redo log buffer.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment