summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2004-07-21 12:10:21 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2004-07-21 12:10:21 +0000
commitd84caa6ccda61ba917d2414b34cf487ddce71202 (patch)
treed149b6178c2071cb38d15a62976cdd8ff48987ae /sys/kern
parentfdcb384533ab1fd50b17effc08ff987556bbaccc (diff)
I was wrong. The assymetry created by the proc argument to rw_enter_write
is horrible and doesn't add anything. Remove it. XXX - the fdplock macro will need a separate cleanup. niklas@ markus@ ok
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_rwlock.c8
-rw-r--r--sys/kern/tty_pty.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c
index 994e1dd5e54..833d879d98c 100644
--- a/sys/kern/kern_rwlock.c
+++ b/sys/kern/kern_rwlock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_rwlock.c,v 1.2 2003/11/18 18:12:14 tedu Exp $ */
+/* $OpenBSD: kern_rwlock.c,v 1.3 2004/07/21 12:10:20 art Exp $ */
/*
* Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org>
* All rights reserved.
@@ -49,8 +49,10 @@ rw_enter_read(struct rwlock *rwl)
}
void
-rw_enter_write(struct rwlock *rwl, struct proc *p)
+rw_enter_write(struct rwlock *rwl)
{
+ struct proc *p = curproc;
+
while (__predict_false(rwl->rwl_owner != 0)) {
/*
* Not the simple case, go to slow path.
@@ -208,7 +210,7 @@ rwlock_testp3(void *a)
printf("rwlock test3 start\n");
tsleep(&local, PWAIT, "rw3", 2);
printf("rwlock test3 exited waiting\n");
- rw_enter_write(&rw_test, curproc);
+ rw_enter_write(&rw_test);
printf("rwlock test3 obtained\n");
tsleep(&local, PWAIT, "rw3/2", 4);
rw_exit_write(&rw_test);
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 3581bf1d5c8..4cd585841c4 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.23 2004/07/09 08:55:41 niklas Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.24 2004/07/21 12:10:20 art Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -167,7 +167,7 @@ check_pty(int minor)
{
struct pt_softc *pti;
- rw_enter_write(&pt_softc_lock, curproc);
+ rw_enter_write(&pt_softc_lock);
if (minor >= npty) {
struct pt_softc **newpt;
int newnpty;
@@ -975,7 +975,7 @@ sysctl_pty(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
err = sysctl_int(oldp, oldlenp, newp, newlen, &newmax);
if (err)
return (err);
- rw_enter_write(&pt_softc_lock, curproc);
+ rw_enter_write(&pt_softc_lock);
/*
* We can't set the max lower than the current
* active value or to a value bigger than a dev_t minor