cleanup: GIANT macros, rename DEPRECIATE to DEPRECATE

Move p_giant_optional to proc zero'd section
Remove (old) XXX zfree comment in pipe code
This commit is contained in:
dillon 2001-07-04 17:11:03 +00:00
parent e028603b7e
commit 8ff7790b1e
3 changed files with 5 additions and 8 deletions

View File

@ -1227,9 +1227,6 @@ pipeclose(cpipe)
* free resources
*/
pipe_free_kmem(cpipe);
/* XXX: erm, doesn't zalloc already have its own locks and
* not need the giant vm lock?
*/
zfree(pipe_zone, cpipe);
}
}

View File

@ -383,10 +383,10 @@ 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_DEPRECIATED(sysctlvar) \
#define START_GIANT_DEPRECATED(sysctlvar) \
int __gotgiant = (curproc->p_giant_optional == 0 && sysctlvar) ? \
(mtx_lock(&Giant), 1) : 0
#define END_GIANT_DEPRECIATED \
#define END_GIANT_DEPRECATED \
if (__gotgiant) mtx_unlock(&Giant)
#define START_GIANT_OPTIONAL \
++curproc->p_giant_optional
@ -396,8 +396,8 @@ do { \
#else /* INVARIANTS */
#define mtx_assert(m, what)
#define GIANT_REQUIRED
#define START_GIANT_DEPRECIATED(sysctl)
#define END_GIANT_DEPRECIATED
#define START_GIANT_DEPRECATED(sysctl)
#define END_GIANT_DEPRECATED
#define START_GIANT_OPTIONAL
#define END_GIANT_OPTIONAL
#endif /* INVARIANTS */

View File

@ -242,6 +242,7 @@ 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
@ -276,7 +277,6 @@ struct proc {
struct pasleep p_asleep; /* (k) Used by asleep()/await(). */
void *p_emuldata; /* (c) Emulator state data. */
struct trapframe *p_frame; /* (k) */
int p_giant_optional; /* (i) Giant Lock Sanity */
};
#define p_session p_pgrp->pg_session