mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-30 16:51:41 +00:00
Get rid of most of the GIANT_XXX assertion defines. Nobody is going to use
them, including me.
This commit is contained in:
parent
df9987602f
commit
36565f036f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82611
@ -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 */
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user