summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/sys_pipe.c3
-rw-r--r--sys/sys/mutex.h8
-rw-r--r--sys/sys/proc.h2
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
OpenPOWER on IntegriCloud