Get rid of most of the GIANT_XXX assertion defines. Nobody is going to use

them, including me.
This commit is contained in:
Matthew Dillon 2001-08-31 00:51:35 +00:00
parent df9987602f
commit 36565f036f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82611
2 changed files with 1 additions and 36 deletions

View file

@ -378,45 +378,11 @@ do { \
#define mtx_assert(m, what) \
_mtx_assert((m), (what), __FILE__, __LINE__)
/*
* GIANT_IRRELEVANT - empty place mark assertion for system startup code
* where serialization is implied or utterly trivial
* routines that do not need giant.
*
* GIANT_REQUIRED - Giant must be held on entry
*
* *_GIANT_DEPRECATED - Giant may or may not be held, we may hold giant here
* based on a sysctl, and no deeper subroutine
* may require giant.
*
* *_GIANT_OPTIONAL - Giant may or may not be held and no deeper subroutine
* may require giant.
*/
#define GIANT_IRRELEVANT
#define GIANT_REQUIRED \
do { \
KASSERT(curproc->p_giant_optional == 0, ("Giant not optional at %s: %d", __FILE__, __LINE__)); \
mtx_assert(&Giant, MA_OWNED); \
} while(0)
#define START_GIANT_DEPRECATED(sysctlvar) \
int __gotgiant = (curproc->p_giant_optional == 0 && sysctlvar) ? \
(mtx_lock(&Giant), 1) : 0
#define END_GIANT_DEPRECATED \
if (__gotgiant) mtx_unlock(&Giant)
#define START_GIANT_OPTIONAL \
++curproc->p_giant_optional
#define END_GIANT_OPTIONAL \
--curproc->p_giant_optional
#define GIANT_REQUIRED mtx_assert(&Giant, MA_OWNED)
#else /* INVARIANTS */
#define mtx_assert(m, what)
#define GIANT_IRRELEVANT
#define GIANT_REQUIRED
#define START_GIANT_DEPRECATED(sysctl)
#define END_GIANT_DEPRECATED
#define START_GIANT_OPTIONAL
#define END_GIANT_OPTIONAL
#endif /* INVARIANTS */
#endif /* _KERNEL */

View file

@ -233,7 +233,6 @@ struct proc {
void *p_aioinfo; /* (c) ASYNC I/O info. */
struct ithd *p_ithd; /* (b) For interrupt threads only. */
int p_intr_nesting_level; /* (k) Interrupt recursion. */
int p_giant_optional; /* (i) Giant Lock Sanity */
/* End area that is zeroed on creation. */
#define p_endzero p_startcopy