Commit 1c154d4c authored by vasil's avatar vasil

Move lock_get_type() from lock/lock0lock.c to include/lock0priv.ic:

* lock0lock.c: remove lock_get_type() and include include/lock0priv.ic
* lock0priv.h: include lock0priv.ic and add lock_get_type() prototype
* Makefile.am: add lock0priv.ic to noinst_HEADERS
* lock0priv.ic: introduce this new file containing the body of
  lock_get_type()

This move is necessary in order to use lock_get_type() from other lock/
source files (it's going to be used in lock/lock0iter.c).

Approved by:	Heikki
parent 8cd3c96e
...@@ -56,7 +56,7 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \ ...@@ -56,7 +56,7 @@ noinst_HEADERS = include/btr0btr.h include/btr0btr.ic \
include/hash0hash.ic include/ibuf0ibuf.h \ include/hash0hash.ic include/ibuf0ibuf.h \
include/ibuf0ibuf.ic include/ibuf0types.h \ include/ibuf0ibuf.ic include/ibuf0types.h \
include/lock0lock.h include/lock0lock.ic \ include/lock0lock.h include/lock0lock.ic \
include/lock0priv.h \ include/lock0priv.h include/lock0priv.ic \
include/lock0types.h include/log0log.h \ include/lock0types.h include/log0log.h \
include/log0log.ic include/log0recv.h \ include/log0log.ic include/log0recv.h \
include/log0recv.ic include/mach0data.h \ include/log0recv.ic include/mach0data.h \
......
...@@ -63,6 +63,15 @@ struct lock_struct { ...@@ -63,6 +63,15 @@ struct lock_struct {
} un_member; } un_member;
}; };
/*************************************************************************
Gets the type of a lock. */
UNIV_INLINE
ulint
lock_get_type(
/*==========*/
/* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock); /* in: lock */
/************************************************************************** /**************************************************************************
Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED, Looks for a set bit in a record lock bitmap. Returns ULINT_UNDEFINED,
if none found. */ if none found. */
...@@ -85,4 +94,8 @@ lock_rec_get_prev( ...@@ -85,4 +94,8 @@ lock_rec_get_prev(
lock_t* in_lock,/* in: record lock */ lock_t* in_lock,/* in: record lock */
ulint heap_no);/* in: heap number of the record */ ulint heap_no);/* in: heap number of the record */
#ifndef UNIV_NONINL
#include "lock0priv.ic"
#endif
#endif /* lock0priv_h */ #endif /* lock0priv_h */
/******************************************************
Lock module internal inline methods.
(c) 2007 Innobase Oy
Created 16/07/2007 Vasil Dimov
*******************************************************/
/* This file contains only methods which are used in
lock/lock0* files, other than lock/lock0lock.c.
I.e. lock/lock0lock.c contains more internal inline
methods but they are used only in that file. */
#ifndef LOCK_MODULE_IMPLEMENTATION
#error Do not include lock0priv.ic outside of the lock/ module
#endif
/*************************************************************************
Gets the type of a lock. */
UNIV_INLINE
ulint
lock_get_type(
/*==========*/
/* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock) /* in: lock */
{
ut_ad(lock);
return(lock->type_mode & LOCK_TYPE_MASK);
}
/* vim: set filetype=c: */
...@@ -13,6 +13,7 @@ Created 5/7/1996 Heikki Tuuri ...@@ -13,6 +13,7 @@ Created 5/7/1996 Heikki Tuuri
#ifdef UNIV_NONINL #ifdef UNIV_NONINL
#include "lock0lock.ic" #include "lock0lock.ic"
#include "lock0priv.ic"
#endif #endif
#include "usr0sess.h" #include "usr0sess.h"
...@@ -367,20 +368,6 @@ lock_deadlock_recursive( ...@@ -367,20 +368,6 @@ lock_deadlock_recursive(
LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK, we LOCK_MAX_DEPTH_IN_DEADLOCK_CHECK, we
return LOCK_VICTIM_IS_START */ return LOCK_VICTIM_IS_START */
/*************************************************************************
Gets the type of a lock. */
UNIV_INLINE
ulint
lock_get_type(
/*==========*/
/* out: LOCK_TABLE or LOCK_REC */
const lock_t* lock) /* in: lock */
{
ut_ad(lock);
return(lock->type_mode & LOCK_TYPE_MASK);
}
/************************************************************************* /*************************************************************************
Gets the nth bit of a record lock. */ Gets the nth bit of a record lock. */
UNIV_INLINE UNIV_INLINE
......
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