summaryrefslogtreecommitdiff
path: root/sys/kern/subr_pool.c
diff options
context:
space:
mode:
authorVisa Hankala <visa@cvs.openbsd.org>2019-04-23 13:35:13 +0000
committerVisa Hankala <visa@cvs.openbsd.org>2019-04-23 13:35:13 +0000
commitdb15e483f2f5e75ad8bbfdaf5ee6bff366cddd10 (patch)
treeabd435dbfd3f96ef09966365d12dab45a8073635 /sys/kern/subr_pool.c
parentad2ed30d0674bbe8c3cf6f1b4f476b382b9e35cb (diff)
Remove file name and line number output from witness(4)
Reduce code clutter by removing the file name and line number output from witness(4). Typically it is easy enough to locate offending locks using the stack traces that are shown in lock order conflict reports. Tricky cases can be tracked using sysctl kern.witness.locktrace=1 . This patch additionally removes the witness(4) wrapper for mutexes. Now each mutex implementation has to invoke the WITNESS_*() macros in order to utilize the checker. Discussed with and OK dlg@, OK mpi@
Diffstat (limited to 'sys/kern/subr_pool.c')
-rw-r--r--sys/kern/subr_pool.c51
1 files changed, 22 insertions, 29 deletions
diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c
index 94ea816183d..1db0dcf3be0 100644
--- a/sys/kern/subr_pool.c
+++ b/sys/kern/subr_pool.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_pool.c,v 1.226 2019/02/10 22:45:57 tedu Exp $ */
+/* $OpenBSD: subr_pool.c,v 1.227 2019/04/23 13:35:12 visa Exp $ */
/* $NetBSD: subr_pool.c,v 1.61 2001/09/26 07:14:56 chs Exp $ */
/*-
@@ -78,9 +78,9 @@ struct pool phpool;
struct pool_lock_ops {
void (*pl_init)(struct pool *, union pool_lock *,
const struct lock_type *);
- void (*pl_enter)(union pool_lock * LOCK_FL_VARS);
- int (*pl_enter_try)(union pool_lock * LOCK_FL_VARS);
- void (*pl_leave)(union pool_lock * LOCK_FL_VARS);
+ void (*pl_enter)(union pool_lock *);
+ int (*pl_enter_try)(union pool_lock *);
+ void (*pl_leave)(union pool_lock *);
void (*pl_assert_locked)(union pool_lock *);
void (*pl_assert_unlocked)(union pool_lock *);
int (*pl_sleep)(void *, union pool_lock *, int, const char *, int);
@@ -99,19 +99,19 @@ static const struct pool_lock_ops pool_lock_ops_rw;
#endif /* WITNESS */
static inline void
-pl_enter(struct pool *pp, union pool_lock *pl LOCK_FL_VARS)
+pl_enter(struct pool *pp, union pool_lock *pl)
{
- pp->pr_lock_ops->pl_enter(pl LOCK_FL_ARGS);
+ pp->pr_lock_ops->pl_enter(pl);
}
static inline int
-pl_enter_try(struct pool *pp, union pool_lock *pl LOCK_FL_VARS)
+pl_enter_try(struct pool *pp, union pool_lock *pl)
{
- return pp->pr_lock_ops->pl_enter_try(pl LOCK_FL_ARGS);
+ return pp->pr_lock_ops->pl_enter_try(pl);
}
static inline void
-pl_leave(struct pool *pp, union pool_lock *pl LOCK_FL_VARS)
+pl_leave(struct pool *pp, union pool_lock *pl)
{
- pp->pr_lock_ops->pl_leave(pl LOCK_FL_ARGS);
+ pp->pr_lock_ops->pl_leave(pl);
}
static inline void
pl_assert_locked(struct pool *pp, union pool_lock *pl)
@@ -130,12 +130,6 @@ pl_sleep(struct pool *pp, void *ident, union pool_lock *lock, int priority,
return pp->pr_lock_ops->pl_sleep(ident, lock, priority, wmesg, timo);
}
-#ifdef WITNESS
-# define pl_enter(pp,pl) pl_enter(pp,pl LOCK_FILE_LINE)
-# define pl_enter_try(pp,pl) pl_enter_try(pp,pl LOCK_FILE_LINE)
-# define pl_leave(pp,pl) pl_leave(pp,pl LOCK_FILE_LINE)
-#endif
-
struct pool_item {
u_long pi_magic;
XSIMPLEQ_ENTRY(pool_item) pi_list;
@@ -2196,21 +2190,21 @@ pool_lock_mtx_init(struct pool *pp, union pool_lock *lock,
}
void
-pool_lock_mtx_enter(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_mtx_enter(union pool_lock *lock)
{
- _mtx_enter(&lock->prl_mtx LOCK_FL_ARGS);
+ mtx_enter(&lock->prl_mtx);
}
int
-pool_lock_mtx_enter_try(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_mtx_enter_try(union pool_lock *lock)
{
- return (_mtx_enter_try(&lock->prl_mtx LOCK_FL_ARGS));
+ return (mtx_enter_try(&lock->prl_mtx));
}
void
-pool_lock_mtx_leave(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_mtx_leave(union pool_lock *lock)
{
- _mtx_leave(&lock->prl_mtx LOCK_FL_ARGS);
+ mtx_leave(&lock->prl_mtx);
}
void
@@ -2250,22 +2244,21 @@ pool_lock_rw_init(struct pool *pp, union pool_lock *lock,
}
void
-pool_lock_rw_enter(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_rw_enter(union pool_lock *lock)
{
- _rw_enter_write(&lock->prl_rwlock LOCK_FL_ARGS);
+ rw_enter_write(&lock->prl_rwlock);
}
int
-pool_lock_rw_enter_try(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_rw_enter_try(union pool_lock *lock)
{
- return (_rw_enter(&lock->prl_rwlock, RW_WRITE | RW_NOSLEEP
- LOCK_FL_ARGS) == 0);
+ return (rw_enter(&lock->prl_rwlock, RW_WRITE | RW_NOSLEEP) == 0);
}
void
-pool_lock_rw_leave(union pool_lock *lock LOCK_FL_VARS)
+pool_lock_rw_leave(union pool_lock *lock)
{
- _rw_exit_write(&lock->prl_rwlock LOCK_FL_ARGS);
+ rw_exit_write(&lock->prl_rwlock);
}
void