diff options
Diffstat (limited to 'storage/innobase/include/mtr0mtr.h')
-rw-r--r-- | storage/innobase/include/mtr0mtr.h | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/storage/innobase/include/mtr0mtr.h b/storage/innobase/include/mtr0mtr.h index d3aa191c27a..4a1d867015d 100644 --- a/storage/innobase/include/mtr0mtr.h +++ b/storage/innobase/include/mtr0mtr.h @@ -37,7 +37,6 @@ Created 11/26/1995 Heikki Tuuri /** Start a mini-transaction. */ #define mtr_start(m) (m)->start() - /** Start a mini-transaction. */ #define mtr_start_trx(m, t) (m)->start((t)) @@ -105,8 +104,7 @@ savepoint. */ /** Check if memo contains the given page. @return TRUE if contains */ #define mtr_memo_contains_page(m, p, t) \ - (m)->memo_contains_page( \ - (m)->get_memo(), (p), (t)) + (m)->memo_contains_page_flagged((p), (t)) #endif /* UNIV_DEBUG */ /** Print info of an mtr handle. */ @@ -280,7 +278,7 @@ struct mtr_t { /** Return current size of the buffer. @return savepoint */ ulint get_savepoint() const - __attribute__((warn_unused_result)) + MY_ATTRIBUTE((warn_unused_result)) { ut_ad(is_active()); ut_ad(m_impl.m_magic_n == MTR_MAGIC_N); @@ -310,7 +308,7 @@ struct mtr_t { /** Get the logging mode. @return logging mode */ inline mtr_log_t get_log_mode() const - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /** Change the logging mode. @param mode logging mode @@ -379,7 +377,7 @@ struct mtr_t { @param type) MLOG_1BYTE, MLOG_2BYTES, MLOG_4BYTES @return value read */ inline ulint read_ulint(const byte* ptr, mlog_id_t type) const - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /** Locks a rw-latch in S mode. NOTE: use mtr_s_lock(). @@ -418,6 +416,10 @@ struct mtr_t { @param type object type: MTR_MEMO_S_LOCK, ... @return bool if lock released */ bool memo_release(const void* object, ulint type); + /** Release a page latch. + @param[in] ptr pointer to within a page frame + @param[in] type object type: MTR_MEMO_PAGE_X_FIX, ... */ + void release_page(const void* ptr, mtr_memo_type_t type); /** Note that the mini-transaction has modified data. */ void set_modified() @@ -494,18 +496,7 @@ struct mtr_t { mtr_buf_t* memo, const void* object, ulint type) - __attribute__((warn_unused_result)); - - /** Check if memo contains the given page. - @param memo memo stack - @param ptr pointer to buffer frame - @param type type of object - @return true if contains */ - static bool memo_contains_page( - mtr_buf_t* memo, - const byte* ptr, - ulint type) - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); /** Check if memo contains the given item. @param object object to search @@ -515,11 +506,18 @@ struct mtr_t { bool memo_contains_flagged(const void* ptr, ulint flags) const; /** Check if memo contains the given page. - @param ptr buffer frame - @param flags specify types of object with OR of + @param[in] ptr pointer to within buffer frame + @param[in] flags specify types of object with OR of MTR_MEMO_PAGE_S_FIX... values - @return true if contains */ - bool memo_contains_page_flagged(const byte* ptr, ulint flags) const; + @return the block + @retval NULL if not found */ + buf_block_t* memo_contains_page_flagged( + const byte* ptr, + ulint flags) const; + + /** Mark the given latched page as modified. + @param[in] ptr pointer to within buffer frame */ + void memo_modify_page(const byte* ptr); /** Print info of an mtr handle. */ void print() const; @@ -594,7 +592,7 @@ struct mtr_t { @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) - __attribute__((warn_unused_result)); + MY_ATTRIBUTE((warn_unused_result)); private: /** Look up the system tablespace. */ |