diff options
author | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-04-12 22:20:15 +0000 |
---|---|---|
committer | Thordur I. Bjornsson <thib@cvs.openbsd.org> | 2007-04-12 22:20:15 +0000 |
commit | d81aff3a8fbdd68e7be2b6805d0562f4c486f7a1 (patch) | |
tree | 911abbf14c7dc001114f037e70695a7999ff2d04 /sys | |
parent | 37f4013a076fcf2727b9b326a013d3678068ac5d (diff) |
Remove the lk_interlock from struct lock; Also remove the LK_INTERLOCK
flag. This effectively makes the simplelock argument to lockmgr() fluff.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/sparc64/sparc64/db_interface.c | 6 | ||||
-rw-r--r-- | sys/kern/kern_lock.c | 26 | ||||
-rw-r--r-- | sys/sys/lock.h | 5 |
3 files changed, 7 insertions, 30 deletions
diff --git a/sys/arch/sparc64/sparc64/db_interface.c b/sys/arch/sparc64/sparc64/db_interface.c index 35fc20317a7..41f01b58768 100644 --- a/sys/arch/sparc64/sparc64/db_interface.c +++ b/sys/arch/sparc64/sparc64/db_interface.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_interface.c,v 1.21 2006/07/06 19:05:56 miod Exp $ */ +/* $OpenBSD: db_interface.c,v 1.22 2007/04/12 22:20:14 thib Exp $ */ /* $NetBSD: db_interface.c,v 1.61 2001/07/31 06:55:47 eeh Exp $ */ /* @@ -714,9 +714,9 @@ db_lock(addr, have_addr, count, modif) } l = (struct lock *)addr; - db_printf("interlock=%x flags=%x\n waitcount=%x sharecount=%x " + db_printf("flags=%x\n waitcount=%x sharecount=%x " "exclusivecount=%x\n wmesg=%s recurselevel=%x\n", - l->lk_interlock.lock_data, l->lk_flags, l->lk_waitcount, + l->lk_flags, l->lk_waitcount, l->lk_sharecount, l->lk_exclusivecount, l->lk_wmesg, l->lk_recurselevel); #else diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 6d51847a770..79e353e2cb9 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.26 2007/04/11 12:06:37 miod Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.27 2007/04/12 22:20:14 thib Exp $ */ /* * Copyright (c) 1995 @@ -68,16 +68,6 @@ void playback_stacktrace(int *, int); #define COUNT(lkp, p, cpu_id, x) #endif /* LOCKDEBUG || DIAGNOSTIC */ /* } */ -#define INTERLOCK_ACQUIRE(lkp, flags) \ -do { \ - simple_lock(&(lkp)->lk_interlock); \ -} while (/*CONSTCOND*/ 0) - -#define INTERLOCK_RELEASE(lkp, flags) \ -do { \ - simple_unlock(&(lkp)->lk_interlock); \ -} while (/*CONSTCOND*/ 0) - #ifdef DDB /* { */ #ifdef MULTIPROCESSOR int simple_lock_debugger = 1; /* more serious on MP */ @@ -104,10 +94,9 @@ do { \ else \ (lkp)->lk_waitcount++; \ /* XXX Cast away volatile. */ \ - error = ltsleep((drain) ? \ + error = tsleep((drain) ? \ (void *)&(lkp)->lk_flags : (void *)(lkp), \ - (lkp)->lk_prio, (lkp)->lk_wmesg, (lkp)->lk_timo, \ - &(lkp)->lk_interlock); \ + (lkp)->lk_prio, (lkp)->lk_wmesg, (lkp)->lk_timo); \ if ((drain) == 0) \ (lkp)->lk_waitcount--; \ if (error) \ @@ -190,7 +179,6 @@ lockinit(struct lock *lkp, int prio, char *wmesg, int timo, int flags) { bzero(lkp, sizeof(struct lock)); - simple_lock_init(&lkp->lk_interlock); lkp->lk_flags = flags & LK_EXTFLG_MASK; lkp->lk_lockholder = LK_NOPROC; lkp->lk_prio = prio; @@ -210,12 +198,10 @@ lockstatus(struct lock *lkp) { int lock_type = 0; - INTERLOCK_ACQUIRE(lkp, lkp->lk_flags); if (lkp->lk_exclusivecount != 0) lock_type = LK_EXCLUSIVE; else if (lkp->lk_sharecount != 0) lock_type = LK_SHARED; - INTERLOCK_RELEASE(lkp, lkp->lk_flags); return (lock_type); } @@ -236,10 +222,6 @@ lockmgr(__volatile struct lock *lkp, u_int flags, struct simplelock *interlkp) struct proc *p = curproc; error = 0; - - INTERLOCK_ACQUIRE(lkp, lkp->lk_flags); - if (flags & LK_INTERLOCK) - simple_unlock(interlkp); extflags = (flags | lkp->lk_flags) & LK_EXTFLG_MASK; #ifdef DIAGNOSTIC @@ -443,7 +425,6 @@ lockmgr(__volatile struct lock *lkp, u_int flags, struct simplelock *interlkp) break; default: - INTERLOCK_RELEASE(lkp, lkp->lk_flags); panic("lockmgr: unknown locktype request %d", flags & LK_TYPE_MASK); /* NOTREACHED */ @@ -455,7 +436,6 @@ lockmgr(__volatile struct lock *lkp, u_int flags, struct simplelock *interlkp) lkp->lk_flags &= ~LK_WAITDRAIN; wakeup((void *)&lkp->lk_flags); } - INTERLOCK_RELEASE(lkp, lkp->lk_flags); return (error); } diff --git a/sys/sys/lock.h b/sys/sys/lock.h index cf658fd9307..735e6f2b2f3 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.h,v 1.17 2007/04/11 12:06:37 miod Exp $ */ +/* $OpenBSD: lock.h,v 1.18 2007/04/12 22:20:14 thib Exp $ */ /* * Copyright (c) 1995 @@ -51,7 +51,6 @@ typedef struct lock *lock_t; * can be gained. The simple locks are defined in <machine/param.h>. */ struct lock { - struct simplelock lk_interlock; /* lock on remaining fields */ u_int lk_flags; /* see below */ int lk_sharecount; /* # of accepted shared locks */ int lk_waitcount; /* # of processes sleeping for lock */ @@ -130,8 +129,6 @@ struct lock { * * Non-persistent external flags. */ -#define LK_INTERLOCK 0x00010000 /* unlock passed simple lock after - getting lk_interlock */ #define LK_RETRY 0x00020000 /* vn_lock: retry until locked */ /* |