diff options
author | dillon <dillon@FreeBSD.org> | 2001-07-04 17:11:03 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-07-04 17:11:03 +0000 |
commit | 8ff7790b1e465b269c4f7e70de474efa728d230f (patch) | |
tree | 89b8a19eb498f54f54f3cc4477f44a70cd1f00c5 | |
parent | e028603b7e3e4fb35cdf00aab533f3965f4a13cc (diff) | |
download | FreeBSD-src-8ff7790b1e465b269c4f7e70de474efa728d230f.zip FreeBSD-src-8ff7790b1e465b269c4f7e70de474efa728d230f.tar.gz |
cleanup: GIANT macros, rename DEPRECIATE to DEPRECATE
Move p_giant_optional to proc zero'd section
Remove (old) XXX zfree comment in pipe code
-rw-r--r-- | sys/kern/sys_pipe.c | 3 | ||||
-rw-r--r-- | sys/sys/mutex.h | 8 | ||||
-rw-r--r-- | sys/sys/proc.h | 2 |
3 files changed, 5 insertions, 8 deletions
diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index 5ee4f5c..dcc57d8 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -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); } } diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index eeca8dc..7c3c412 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -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 */ diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 78cfe4f..277fbee 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -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 |