Skip to content
Permalink
Browse files

mtr_t::is_block_dirtied(): Define inline

  • Loading branch information...
dr-m committed Jun 16, 2019
1 parent a94638f commit 2b660fb4c212973ba0f118b47336b608d091f327
Showing with 16 additions and 16 deletions.
  1. +1 −1 storage/innobase/include/mtr0mtr.h
  2. +15 −1 storage/innobase/include/mtr0mtr.ic
  3. +0 −14 storage/innobase/mtr/mtr0mtr.cc
@@ -550,7 +550,7 @@ struct mtr_t {
/** Check if this mini-transaction is dirtying a clean page.
@param block block being x-fixed
@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));

private:
@@ -1,7 +1,7 @@
/*****************************************************************************

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
the terms of the GNU General Public License as published by the Free Software
@@ -26,6 +26,20 @@ Created 11/26/1995 Heikki Tuuri

#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. */
void
@@ -457,20 +457,6 @@ class mtr_t::Command {
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 */
struct mtr_write_log_t {
/** Append a block to the redo log buffer.

0 comments on commit 2b660fb

Please sign in to comment.
You can’t perform that action at this time.