diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-11-19 02:18:03 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2005-11-19 02:18:03 +0000 |
commit | 4e00bfe9e4fce563a74dcd487149539b6bc02ba9 (patch) | |
tree | a134970c4687287588758bb78c439e9cde819bb9 /sys | |
parent | 16017b33d1fad6b6fd295f39b365b33719b42ae9 (diff) |
Remove unnecessary lockmgr() archaism that was costing too much in terms
of panics and bugfixes. Access curproc directly, do not expect a process
pointer as an argument. Should fix many "process context required" bugs.
Incentive and okay millert@, okay marc@. Various testing, thanks.
Diffstat (limited to 'sys')
40 files changed, 200 insertions, 247 deletions
diff --git a/sys/adosfs/adutil.c b/sys/adosfs/adutil.c index 80cfa6d73df..0b3cc2cf4bf 100644 --- a/sys/adosfs/adutil.c +++ b/sys/adosfs/adutil.c @@ -1,4 +1,4 @@ -/* $OpenBSD: adutil.c,v 1.14 2003/12/21 15:28:59 miod Exp $ */ +/* $OpenBSD: adutil.c,v 1.15 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: adutil.c,v 1.15 1996/10/13 02:52:07 christos Exp $ */ /* @@ -88,20 +88,17 @@ adosfs_ainshash(amp, ap) struct adosfsmount *amp; struct anode *ap; { - struct proc *p = curproc; /* XXX */ struct anodechain *hp; struct anode *aq; /* lock the inode, then put it on the appropriate hash list */ - lockmgr(&ap->a_lock, LK_EXCLUSIVE, (struct simplelock *)0, p); + lockmgr(&ap->a_lock, LK_EXCLUSIVE, NULL); hp = &->anodetab[AHASH(ap->block)]; for (aq = hp->lh_first; aq ; aq = aq->link.le_next) { if (aq->block == ap->block) { - lockmgr(&ap->a_lock, LK_RELEASE, - (struct simplelock *)0, p); - + lockmgr(&ap->a_lock, LK_RELEASE, NULL); return (EEXIST); } } diff --git a/sys/adosfs/advnops.c b/sys/adosfs/advnops.c index db84baf8595..279d9dc46fe 100644 --- a/sys/adosfs/advnops.c +++ b/sys/adosfs/advnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: advnops.c,v 1.30 2003/12/21 15:28:59 miod Exp $ */ +/* $OpenBSD: advnops.c,v 1.31 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: advnops.c,v 1.32 1996/10/13 02:52:09 christos Exp $ */ /* @@ -507,8 +507,7 @@ adosfs_lock(v) advopprint(ap); #endif - rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags, &vp->v_interlock, - ap->a_p); + rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags, &vp->v_interlock); #ifdef ADOSFS_DIAGNOSTIC printf(" %d)", rv); @@ -534,7 +533,7 @@ adosfs_unlock(v) #endif rv = lockmgr(&VTOA(vp)->a_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p); + &vp->v_interlock); #ifdef ADOSFS_DIAGNOSTIC printf(" %d)", rv); diff --git a/sys/arch/amd64/amd64/gdt.c b/sys/arch/amd64/amd64/gdt.c index 73a267ca697..9a72648bfec 100644 --- a/sys/arch/amd64/amd64/gdt.c +++ b/sys/arch/amd64/amd64/gdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt.c,v 1.6 2005/09/25 20:48:18 miod Exp $ */ +/* $OpenBSD: gdt.c,v 1.7 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: gdt.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */ /*- @@ -82,14 +82,14 @@ static __inline void gdt_lock() { if (curproc != NULL) /* XXX - ugh. needed for startup */ - (void) lockmgr(&gdt_lock_store, LK_EXCLUSIVE, NULL, curproc); + (void) lockmgr(&gdt_lock_store, LK_EXCLUSIVE, NULL); } static __inline void gdt_unlock() { if (curproc != NULL) - (void) lockmgr(&gdt_lock_store, LK_RELEASE, NULL, curproc); + (void) lockmgr(&gdt_lock_store, LK_RELEASE, NULL); } void diff --git a/sys/arch/arm/xscale/pxa2x0_apm.c b/sys/arch/arm/xscale/pxa2x0_apm.c index e12f87506c2..594e41c1b9f 100644 --- a/sys/arch/arm/xscale/pxa2x0_apm.c +++ b/sys/arch/arm/xscale/pxa2x0_apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pxa2x0_apm.c,v 1.18 2005/11/19 01:59:36 aaron Exp $ */ +/* $OpenBSD: pxa2x0_apm.c,v 1.19 2005/11/19 02:18:00 pedro Exp $ */ /*- * Copyright (c) 2001 Alexander Guy. All rights reserved. @@ -62,8 +62,8 @@ #define DPRINTF(x) /**/ #endif -#define APM_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL, curproc) -#define APM_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL, curproc) +#define APM_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL) +#define APM_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL) struct cfdriver apm_cd = { NULL, "apm", DV_DULL diff --git a/sys/arch/i386/i386/apm.c b/sys/arch/i386/i386/apm.c index 0d097d4bcfb..ab130a7a2e8 100644 --- a/sys/arch/i386/i386/apm.c +++ b/sys/arch/i386/i386/apm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apm.c,v 1.66 2005/06/16 16:49:04 beck Exp $ */ +/* $OpenBSD: apm.c,v 1.67 2005/11/19 02:18:00 pedro Exp $ */ /*- * Copyright (c) 1998-2001 Michael Shalayeff. All rights reserved. @@ -75,8 +75,8 @@ #define DPRINTF(x) /**/ #endif -#define APM_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL, curproc) -#define APM_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL, curproc) +#define APM_LOCK(sc) lockmgr(&(sc)->sc_lock, LK_EXCLUSIVE, NULL) +#define APM_UNLOCK(sc) lockmgr(&(sc)->sc_lock, LK_RELEASE, NULL) struct cfdriver apm_cd = { NULL, "apm", DV_DULL diff --git a/sys/arch/i386/i386/gdt.c b/sys/arch/i386/i386/gdt.c index bfe166f6bea..c3c2cdf6c41 100644 --- a/sys/arch/i386/i386/gdt.c +++ b/sys/arch/i386/i386/gdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt.c,v 1.23 2005/09/25 20:48:21 miod Exp $ */ +/* $OpenBSD: gdt.c,v 1.24 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: gdt.c,v 1.28 2002/12/14 09:38:50 junyoung Exp $ */ /*- @@ -95,15 +95,14 @@ static __inline void gdt_lock() { if (curproc != NULL) - lockmgr(&gdt_lock_store, LK_EXCLUSIVE, &gdt_simplelock, - curproc); + lockmgr(&gdt_lock_store, LK_EXCLUSIVE, &gdt_simplelock); } static __inline void gdt_unlock() { if (curproc != NULL) - lockmgr(&gdt_lock_store, LK_RELEASE, &gdt_simplelock, curproc); + lockmgr(&gdt_lock_store, LK_RELEASE, &gdt_simplelock); } /* XXX needs spinlocking if we ever mean to go finegrained. */ diff --git a/sys/arch/macppc/dev/ki2c.c b/sys/arch/macppc/dev/ki2c.c index c0cf0292e5d..902fb052996 100644 --- a/sys/arch/macppc/dev/ki2c.c +++ b/sys/arch/macppc/dev/ki2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ki2c.c,v 1.8 2005/11/18 23:19:28 kettenis Exp $ */ +/* $OpenBSD: ki2c.c,v 1.9 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: ki2c.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -349,7 +349,7 @@ ki2c_i2c_acquire_bus(void *cookie, int flags) { struct ki2c_softc *sc = cookie; - return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL, curproc)); + return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL)); } void @@ -357,7 +357,7 @@ ki2c_i2c_release_bus(void *cookie, int flags) { struct ki2c_softc *sc = cookie; - (void) lockmgr(&sc->sc_buslock, LK_RELEASE, NULL, curproc); + (void) lockmgr(&sc->sc_buslock, LK_RELEASE, NULL); } int diff --git a/sys/arch/macppc/dev/pi2c.c b/sys/arch/macppc/dev/pi2c.c index cf2e55d2d0b..c76f5caced9 100644 --- a/sys/arch/macppc/dev/pi2c.c +++ b/sys/arch/macppc/dev/pi2c.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pi2c.c,v 1.1 2005/11/16 12:28:54 kettenis Exp $ */ +/* $OpenBSD: pi2c.c,v 1.2 2005/11/19 02:18:00 pedro Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -84,7 +84,7 @@ pi2c_i2c_acquire_bus(void *cookie, int flags) { struct pi2c_softc *sc = cookie; - return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL, curproc)); + return (lockmgr(&sc->sc_buslock, LK_EXCLUSIVE, NULL)); } void @@ -92,7 +92,7 @@ pi2c_i2c_release_bus(void *cookie, int flags) { struct pi2c_softc *sc = cookie; - lockmgr(&sc->sc_buslock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_buslock, LK_RELEASE, NULL); } int diff --git a/sys/arch/macppc/dev/smu.c b/sys/arch/macppc/dev/smu.c index 4505aa99f49..389a3754c35 100644 --- a/sys/arch/macppc/dev/smu.c +++ b/sys/arch/macppc/dev/smu.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smu.c,v 1.7 2005/11/15 23:28:52 dlg Exp $ */ +/* $OpenBSD: smu.c,v 1.8 2005/11/19 02:18:00 pedro Exp $ */ /* * Copyright (c) 2005 Mark Kettenis @@ -393,7 +393,7 @@ smu_time_read(time_t *secs) struct clock_ymdhms dt; int error; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); cmd->cmd = SMU_RTC; cmd->len = 1; @@ -411,7 +411,7 @@ smu_time_read(time_t *secs) dt.dt_min = FROMBCD(cmd->data[1]); dt.dt_sec = FROMBCD(cmd->data[0]); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); *secs = clock_ymdhms_to_secs(&dt); return (0); @@ -427,7 +427,7 @@ smu_time_write(time_t secs) clock_secs_to_ymdhms(secs, &dt); - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); cmd->cmd = SMU_RTC; cmd->len = 8; @@ -441,7 +441,7 @@ smu_time_write(time_t secs) cmd->data[7] = TOBCD(dt.dt_year - 2000); error = smu_do_cmd(sc, 800); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (error); } @@ -581,12 +581,12 @@ smu_refresh_sensors(void *arg) struct smu_softc *sc = arg; int i; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); for (i = 0; i < sc->sc_num_sensors; i++) smu_sensor_refresh(sc, &sc->sc_sensors[i]); for (i = 0; i < sc->sc_num_fans; i++) smu_fan_refresh(sc, &sc->sc_fans[i]); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); } int @@ -597,7 +597,7 @@ smu_i2c_acquire_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return (0); - return (lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc)); + return (lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL)); } void @@ -608,7 +608,7 @@ smu_i2c_release_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return; - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); } int diff --git a/sys/dev/i2o/iop.c b/sys/dev/i2o/iop.c index 203801c57ad..7239d9b417e 100644 --- a/sys/dev/i2o/iop.c +++ b/sys/dev/i2o/iop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iop.c,v 1.26 2005/01/06 11:06:13 miod Exp $ */ +/* $OpenBSD: iop.c,v 1.27 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: iop.c,v 1.12 2001/03/21 14:27:05 ad Exp $ */ /*- @@ -545,12 +545,12 @@ iop_config_interrupts(struct device *self) config_found_sm(self, &ia, iop_vendor_print, iop_submatch); #endif - lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL); if ((rv = iop_reconfigure(sc, 0)) == -1) { printf("%s: configure failed (%d)\n", sc->sc_dv.dv_xname, rv); return; } - lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_conflock, LK_RELEASE, NULL); kthread_create_deferred(iop_create_reconf_thread, sc); } @@ -584,7 +584,6 @@ void iop_reconf_thread(void *cookie) { struct iop_softc *sc = cookie; - struct proc *p = sc->sc_reconf_proc; struct i2o_lct lct; u_int32_t chgind; int rv; @@ -603,10 +602,10 @@ iop_reconf_thread(void *cookie) sc->sc_dv.dv_xname, letoh32(lct.changeindicator), rv)); if (rv == 0 && - lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL, p) == 0) { + lockmgr(&sc->sc_conflock, LK_EXCLUSIVE, NULL) == 0) { iop_reconfigure(sc, letoh32(lct.changeindicator)); chgind = sc->sc_chgind + 1; - lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, p); + lockmgr(&sc->sc_conflock, LK_RELEASE, NULL); } tsleep(iop_reconf_thread, PWAIT, "iopzzz", hz * 5); @@ -2380,7 +2379,7 @@ iopioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) return (ENOTTY); } - if ((rv = lockmgr(&sc->sc_conflock, LK_SHARED, NULL, p)) != 0) + if ((rv = lockmgr(&sc->sc_conflock, LK_SHARED, NULL)) != 0) return (rv); switch (cmd) { @@ -2409,7 +2408,7 @@ iopioctl(dev_t dev, u_long cmd, caddr_t data, int flag, struct proc *p) break; } - lockmgr(&sc->sc_conflock, LK_RELEASE, NULL, p); + lockmgr(&sc->sc_conflock, LK_RELEASE, NULL); return (rv); } diff --git a/sys/dev/i2o/iopsp.c b/sys/dev/i2o/iopsp.c index 0626df4d9c5..4fc885728a7 100644 --- a/sys/dev/i2o/iopsp.c +++ b/sys/dev/i2o/iopsp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iopsp.c,v 1.7 2003/01/13 03:56:47 mickey Exp $ */ +/* $OpenBSD: iopsp.c,v 1.8 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD$ */ /*- @@ -376,7 +376,7 @@ iopsp_rescan(struct iopsp_softc *sc) iop = (struct iop_softc *)sc->sc_dv.dv_parent; - rv = lockmgr(&iop->sc_conflock, LK_EXCLUSIVE, NULL, curproc); + rv = lockmgr(&iop->sc_conflock, LK_EXCLUSIVE, NULL); if (rv != 0) { #ifdef I2ODEBUG printf("iopsp_rescan: unable to acquire lock\n"); @@ -400,7 +400,7 @@ iopsp_rescan(struct iopsp_softc *sc) if ((rv = iop_lct_get(iop)) == 0) rv = iopsp_reconfig(&sc->sc_dv); - lockmgr(&iop->sc_conflock, LK_RELEASE, NULL, curproc); + lockmgr(&iop->sc_conflock, LK_RELEASE, NULL); return (rv); } diff --git a/sys/dev/isa/gscsio.c b/sys/dev/isa/gscsio.c index 7ce7a91b1bb..7fd258dd445 100644 --- a/sys/dev/isa/gscsio.c +++ b/sys/dev/isa/gscsio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gscsio.c,v 1.3 2004/11/17 16:53:05 mickey Exp $ */ +/* $OpenBSD: gscsio.c,v 1.4 2005/11/19 02:18:00 pedro Exp $ */ /* * Copyright (c) 2004 Alexander Yurchenko <grange@openbsd.org> * @@ -320,7 +320,7 @@ gscsio_acb_acquire_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return (0); - return (lockmgr(&acb->buslock, LK_EXCLUSIVE, NULL, curproc)); + return (lockmgr(&acb->buslock, LK_EXCLUSIVE, NULL)); } void @@ -331,7 +331,7 @@ gscsio_acb_release_bus(void *cookie, int flags) if (flags & I2C_F_POLL) return; - lockmgr(&acb->buslock, LK_RELEASE, NULL, curproc); + lockmgr(&acb->buslock, LK_RELEASE, NULL); } int diff --git a/sys/dev/pci/vga_pci.c b/sys/dev/pci/vga_pci.c index 0229bf099ff..0df6667c1da 100644 --- a/sys/dev/pci/vga_pci.c +++ b/sys/dev/pci/vga_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga_pci.c,v 1.19 2005/11/10 22:57:37 martin Exp $ */ +/* $OpenBSD: vga_pci.c,v 1.20 2005/11/19 02:18:00 pedro Exp $ */ /* $NetBSD: vga_pci.c,v 1.3 1998/06/08 06:55:58 thorpej Exp $ */ /*- @@ -546,7 +546,7 @@ agp_free_gatt(struct vga_pci_softc *sc, struct agp_gatt *gatt) int agp_generic_detach(struct vga_pci_softc *sc) { - lockmgr(&sc->sc_lock, LK_DRAIN, NULL, curproc); + lockmgr(&sc->sc_lock, LK_DRAIN, NULL); agp_flush_cache(); return 0; } @@ -664,11 +664,11 @@ agp_generic_bind_memory(struct vga_pci_softc *sc, struct agp_memory *mem, off_t i, k; int contigpages, nseg, error; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); if (mem->am_is_bound) { printf("AGP: memory already bound\n"); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return EINVAL; } @@ -677,7 +677,7 @@ agp_generic_bind_memory(struct vga_pci_softc *sc, struct agp_memory *mem, || offset + mem->am_size > AGP_GET_APERTURE(sc)) { printf("AGP: binding memory at bad offset %#lx\n", (unsigned long) offset); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return EINVAL; } @@ -729,7 +729,7 @@ agp_generic_bind_memory(struct vga_pci_softc *sc, struct agp_memory *mem, } if (contigpages == 0) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return ENOMEM; } @@ -767,7 +767,7 @@ agp_generic_bind_memory(struct vga_pci_softc *sc, struct agp_memory *mem, bus_dmamem_free(sc->sc_dmat, mem->am_dmaseg, mem->am_nseg); free(mem->am_dmaseg, M_DEVBUF); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return error; } } @@ -788,7 +788,7 @@ agp_generic_bind_memory(struct vga_pci_softc *sc, struct agp_memory *mem, mem->am_offset = offset; mem->am_is_bound = 1; - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return 0; } @@ -798,11 +798,11 @@ agp_generic_unbind_memory(struct vga_pci_softc *sc, struct agp_memory *mem) { int i; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); if (!mem->am_is_bound) { printf("AGP: memory is not bound\n"); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return EINVAL; } @@ -826,7 +826,7 @@ agp_generic_unbind_memory(struct vga_pci_softc *sc, struct agp_memory *mem) mem->am_offset = 0; mem->am_is_bound = 0; - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return 0; } diff --git a/sys/dev/systrace.c b/sys/dev/systrace.c index 2c1fced238c..9fa8f3292cd 100644 --- a/sys/dev/systrace.c +++ b/sys/dev/systrace.c @@ -1,4 +1,4 @@ -/* $OpenBSD: systrace.c,v 1.38 2005/04/17 22:11:34 millert Exp $ */ +/* $OpenBSD: systrace.c,v 1.39 2005/11/19 02:18:00 pedro Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> * All rights reserved. @@ -139,13 +139,13 @@ struct lock systrace_lck; static __inline void systrace_lock(void) { - lockmgr(&systrace_lck, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&systrace_lck, LK_EXCLUSIVE, NULL); } static __inline void systrace_unlock(void) { - lockmgr(&systrace_lck, LK_RELEASE, NULL, curproc); + lockmgr(&systrace_lck, LK_RELEASE, NULL); } /* Needs to be called with fst locked */ @@ -216,7 +216,7 @@ systracef_read(fp, poff, uio, cred) again: systrace_lock(); - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if ((process = TAILQ_FIRST(&fst->messages)) != NULL) { error = uiomove((caddr_t)&process->msg, @@ -236,7 +236,7 @@ systracef_read(fp, poff, uio, cred) if (fp->f_flag & FNONBLOCK) error = EAGAIN; else { - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); error = tsleep(fst, PWAIT|PCATCH, "systrrd", 0); if (error) goto out; @@ -245,7 +245,7 @@ systracef_read(fp, poff, uio, cred) } - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); out: return (error); } @@ -333,7 +333,7 @@ systracef_ioctl(fp, cmd, data, p) return (ret); systrace_lock(); - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (pid) { strp = systrace_findpid(fst, pid); @@ -405,7 +405,7 @@ systracef_ioctl(fp, cmd, data, p) } unlock: - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); return (ret); } @@ -423,13 +423,13 @@ systracef_poll(fp, events, p) return (0); systrace_lock(); - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (!TAILQ_EMPTY(&fst->messages)) revents = events & (POLLIN | POLLRDNORM); else selrecord(p, &fst->si); - lockmgr(&fst->lock, LK_RELEASE, NULL, p); + lockmgr(&fst->lock, LK_RELEASE, NULL); return (revents); } @@ -464,7 +464,7 @@ systracef_close(fp, p) struct str_policy *strpol; systrace_lock(); - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); /* Untrace all processes */ @@ -493,7 +493,7 @@ systracef_close(fp, p) vrele(fst->fd_cdir); if (fst->fd_rdir) vrele(fst->fd_rdir); - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); FREE(fp->f_data, M_XDATA); fp->f_data = NULL; @@ -639,14 +639,14 @@ systrace_exit(struct proc *proc) strp = proc->p_systrace; if (strp != NULL) { fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); /* Insert Exit message */ systrace_msg_child(fst, strp, -1); systrace_detach(strp); - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); } else systrace_unlock(); CLR(proc->p_flag, P_SYSTRACE); @@ -666,7 +666,7 @@ systrace_fork(struct proc *oldproc, struct proc *p) } fst = oldstrp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (systrace_insert_process(fst, p)) @@ -681,7 +681,7 @@ systrace_fork(struct proc *oldproc, struct proc *p) /* Insert fork message */ systrace_msg_child(fst, oldstrp, p->p_pid); out: - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); } #define REACQUIRE_LOCK do { \ @@ -692,7 +692,7 @@ systrace_fork(struct proc *oldproc, struct proc *p) return (error); \ } \ fst = strp->parent; \ - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); \ + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); \ systrace_unlock(); \ } while (0) @@ -725,7 +725,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); /* @@ -769,7 +769,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) error = EPERM; } systrace_replacefree(strp); - lockmgr(&fst->lock, LK_RELEASE, NULL, p); + lockmgr(&fst->lock, LK_RELEASE, NULL); if (policy == SYSTR_POLICY_PERMIT) error = (*callp->sy_call)(p, v, retval); return (error); @@ -798,7 +798,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) } fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (strp->answer == SYSTR_POLICY_NEVER) { @@ -833,7 +833,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) } else CLR(strp->flags, STR_PROC_SETEUID|STR_PROC_SETEGID); - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); error = (*callp->sy_call)(p, v, retval); @@ -876,7 +876,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) /* Acquire lock */ fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (p->p_emul != oldemul) { @@ -908,7 +908,7 @@ systrace_redirect(int code, struct proc *p, void *v, register_t *retval) } out_unlock: - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); out: return (error); } @@ -1321,7 +1321,7 @@ systrace_execve1(char *path, struct proc *p) msg_execve = &strp->msg.msg_data.msg_execve; fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); /* @@ -1332,7 +1332,7 @@ systrace_execve1(char *path, struct proc *p) if (fst->issuser || fst->p_ruid != p->p_cred->p_ruid || fst->p_rgid != p->p_cred->p_rgid) { - lockmgr(&fst->lock, LK_RELEASE, NULL, p); + lockmgr(&fst->lock, LK_RELEASE, NULL); return; } strlcpy(msg_execve->path, path, MAXPATHLEN); @@ -1475,7 +1475,7 @@ systrace_scriptname(struct proc *p, char *dst) strp = p->p_systrace; fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); if (!fst->issuser && (ISSET(p->p_flag, P_SUGID) || @@ -1498,7 +1498,7 @@ systrace_scriptname(struct proc *p, char *dst) out: strp->scriptname[0] = '\0'; - lockmgr(&fst->lock, LK_RELEASE, NULL, p); + lockmgr(&fst->lock, LK_RELEASE, NULL); return (error); } @@ -1516,7 +1516,7 @@ systrace_namei(struct nameidata *ndp) strp = cnp->cn_proc->p_systrace; if (strp != NULL) { fst = strp->parent; - lockmgr(&fst->lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&fst->lock, LK_EXCLUSIVE, NULL); systrace_unlock(); for (i = 0; i < strp->nfname; i++) @@ -1529,7 +1529,7 @@ systrace_namei(struct nameidata *ndp) strcmp(cnp->cn_pnbuf, strp->scriptname) == 0) hamper = 1; - lockmgr(&fst->lock, LK_RELEASE, NULL, curproc); + lockmgr(&fst->lock, LK_RELEASE, NULL); } else systrace_unlock(); @@ -1746,7 +1746,6 @@ systrace_make_msg(struct str_process *strp, int type) { struct str_message *msg = &strp->msg; struct fsystrace *fst = strp->parent; - struct proc *p = strp->proc; int st, pri; pri = PWAIT|PCATCH; @@ -1772,7 +1771,7 @@ systrace_make_msg(struct str_process *strp, int type) systrace_wakeup(fst); /* Release the lock - XXX */ - lockmgr(&fst->lock, LK_RELEASE, NULL, p); + lockmgr(&fst->lock, LK_RELEASE, NULL); while (1) { st = tsleep(strp, pri, "systrmsg", 0); diff --git a/sys/dev/usb/usb_port.h b/sys/dev/usb/usb_port.h index f14cd65d90f..e32e5287831 100644 --- a/sys/dev/usb/usb_port.h +++ b/sys/dev/usb/usb_port.h @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_port.h,v 1.59 2005/09/26 22:19:01 miod Exp $ */ +/* $OpenBSD: usb_port.h,v 1.60 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: usb_port.h,v 1.62 2003/02/15 18:33:30 augustss Exp $ */ /* $FreeBSD: src/sys/dev/usb/usb_port.h,v 1.21 1999/11/17 22:33:47 n_hibma Exp $ */ @@ -322,7 +322,7 @@ typedef struct timeout usb_callout_t; #define usb_callout_pending(h) timeout_pending(&(h)) #define usb_uncallout(h, f, d) timeout_del(&(h)) -#define usb_lockmgr(l, f, sl, p) lockmgr((l), (f), (sl), (p)) +#define usb_lockmgr(l, f, sl, p) lockmgr((l), (f), (sl)) #define USB_DECLARE_DRIVER_CLASS(dname, devclass) \ int __CONCAT(dname,_match)(struct device *, void *, void *); \ diff --git a/sys/isofs/cd9660/cd9660_node.c b/sys/isofs/cd9660/cd9660_node.c index 1157acdd349..f7c6abda357 100644 --- a/sys/isofs/cd9660/cd9660_node.c +++ b/sys/isofs/cd9660/cd9660_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_node.c,v 1.14 2003/06/02 23:28:05 millert Exp $ */ +/* $OpenBSD: cd9660_node.c,v 1.15 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: cd9660_node.c,v 1.17 1997/05/05 07:13:57 mycroft Exp $ */ /*- @@ -181,7 +181,6 @@ int cd9660_ihashins(ip) struct iso_node *ip; { - struct proc *p = curproc; struct iso_node **ipp, *iq; simple_lock(&cd9660_ihash_slock); @@ -200,7 +199,8 @@ cd9660_ihashins(ip) *ipp = ip; simple_unlock(&cd9660_ihash_slock); - lockmgr(&ip->i_lock, LK_EXCLUSIVE, 0, p); + lockmgr(&ip->i_lock, LK_EXCLUSIVE, NULL); + return (0); } diff --git a/sys/isofs/cd9660/cd9660_vnops.c b/sys/isofs/cd9660/cd9660_vnops.c index 3d6db24113d..c21d5cc0a88 100644 --- a/sys/isofs/cd9660/cd9660_vnops.c +++ b/sys/isofs/cd9660/cd9660_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cd9660_vnops.c,v 1.32 2004/11/29 17:05:05 grange Exp $ */ +/* $OpenBSD: cd9660_vnops.c,v 1.33 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: cd9660_vnops.c,v 1.42 1997/10/16 23:56:57 christos Exp $ */ /*- @@ -872,8 +872,7 @@ cd9660_lock(v) } */ *ap = v; struct vnode *vp = ap->a_vp; - return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock, - ap->a_p)); + return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock)); } /* @@ -889,7 +888,7 @@ cd9660_unlock(v) struct vnode *vp = ap->a_vp; return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + &vp->v_interlock)); } /* diff --git a/sys/isofs/udf/udf_vnops.c b/sys/isofs/udf/udf_vnops.c index fe1f66c570f..cf197034885 100644 --- a/sys/isofs/udf/udf_vnops.c +++ b/sys/isofs/udf/udf_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: udf_vnops.c,v 1.8 2005/10/29 00:17:19 pedro Exp $ */ +/* $OpenBSD: udf_vnops.c,v 1.9 2005/11/19 02:18:01 pedro Exp $ */ /* * Copyright (c) 2001, 2002 Scott Long <scottl@freebsd.org> @@ -915,8 +915,7 @@ udf_lock(void *v) struct vnode *vp = ap->a_vp; - return (lockmgr(&VTON(vp)->i_lock, ap->a_flags, &vp->v_interlock, - ap->a_p)); + return (lockmgr(&VTON(vp)->i_lock, ap->a_flags, &vp->v_interlock)); } int @@ -931,7 +930,7 @@ udf_unlock(void *v) struct vnode *vp = ap->a_vp; return (lockmgr(&VTON(vp)->i_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + &vp->v_interlock)); } int diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c index 3bcb5928023..9ba2ed1e567 100644 --- a/sys/kern/kern_lock.c +++ b/sys/kern/kern_lock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_lock.c,v 1.19 2005/05/29 03:20:41 deraadt Exp $ */ +/* $OpenBSD: kern_lock.c,v 1.20 2005/11/19 02:18:01 pedro Exp $ */ /* * Copyright (c) 1995 @@ -354,17 +354,17 @@ lockstatus(lkp) * accepted shared locks and shared-to-exclusive upgrades to go away. */ int -lockmgr(lkp, flags, interlkp, p) +lockmgr(lkp, flags, interlkp) __volatile struct lock *lkp; u_int flags; struct simplelock *interlkp; - struct proc *p; { int error; pid_t pid; int extflags; cpuid_t cpu_id; int s = 0; + struct proc *p = curproc; error = 0; diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 0683bb348b3..cf4409a2387 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_malloc.c,v 1.60 2005/09/12 23:05:06 miod Exp $ */ +/* $OpenBSD: kern_malloc.c,v 1.61 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */ /* @@ -579,7 +579,7 @@ sysctl_malloc(name, namelen, oldp, oldlenp, newp, newlen, p) if (memall == NULL) { int totlen; - i = lockmgr(&sysctl_kmemlock, LK_EXCLUSIVE, NULL, p); + i = lockmgr(&sysctl_kmemlock, LK_EXCLUSIVE, NULL); if (i) return (i); @@ -605,7 +605,7 @@ sysctl_malloc(name, namelen, oldp, oldlenp, newp, newlen, p) for (i = 0; i < totlen; i++) if (memall[i] == ' ') memall[i] = '_'; - lockmgr(&sysctl_kmemlock, LK_RELEASE, NULL, p); + lockmgr(&sysctl_kmemlock, LK_RELEASE, NULL); } return (sysctl_rdstring(oldp, oldlenp, newp, memall)); #else diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 064aca59438..c4980064163 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sysctl.c,v 1.133 2005/11/10 08:10:16 dlg Exp $ */ +/* $OpenBSD: kern_sysctl.c,v 1.134 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: kern_sysctl.c,v 1.17 1996/05/20 17:49:05 mrg Exp $ */ /*- @@ -202,13 +202,13 @@ sys___sysctl(p, v, retval) (error = copyin(SCARG(uap, oldlenp), &oldlen, sizeof(oldlen)))) return (error); if (SCARG(uap, old) != NULL) { - if ((error = lockmgr(&sysctl_lock, LK_EXCLUSIVE, NULL, p)) != 0) + if ((error = lockmgr(&sysctl_lock, LK_EXCLUSIVE, NULL)) != 0) return (error); if (dolock) { error = uvm_vslock(p, SCARG(uap, old), oldlen, VM_PROT_READ|VM_PROT_WRITE); if (error) { - lockmgr(&sysctl_lock, LK_RELEASE, NULL, p); + lockmgr(&sysctl_lock, LK_RELEASE, NULL); return (error); } } @@ -219,7 +219,7 @@ sys___sysctl(p, v, retval) if (SCARG(uap, old) != NULL) { if (dolock) uvm_vsunlock(p, SCARG(uap, old), savelen); - lockmgr(&sysctl_lock, LK_RELEASE, NULL, p); + lockmgr(&sysctl_lock, LK_RELEASE, NULL); } if (error) return (error); @@ -1615,7 +1615,7 @@ sysctl_diskinit(update, p) struct disk *dk; int i, tlen, l; - if ((i = lockmgr(&sysctl_disklock, LK_EXCLUSIVE, NULL, p)) != 0) + if ((i = lockmgr(&sysctl_disklock, LK_EXCLUSIVE, NULL)) != 0) return i; if (disk_change) { @@ -1676,7 +1676,7 @@ sysctl_diskinit(update, p) sdk->ds_time = dk->dk_time; } } - lockmgr(&sysctl_disklock, LK_RELEASE, NULL, p); + lockmgr(&sysctl_disklock, LK_RELEASE, NULL); return 0; } diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index 985f430beb3..40068add293 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: subr_disk.c,v 1.29 2004/12/26 21:22:13 miod Exp $ */ +/* $OpenBSD: subr_disk.c,v 1.30 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */ /* @@ -391,14 +391,13 @@ disk_unbusy(diskp, bcount, read) add_disk_randomness(bcount ^ diff_time.tv_usec); } - int disk_lock(dk) struct disk *dk; { int error; - error = lockmgr(&dk->dk_lock, LK_EXCLUSIVE, 0, curproc); + error = lockmgr(&dk->dk_lock, LK_EXCLUSIVE, NULL); return (error); } @@ -407,10 +406,9 @@ void disk_unlock(dk) struct disk *dk; { - lockmgr(&dk->dk_lock, LK_RELEASE, 0, curproc); + lockmgr(&dk->dk_lock, LK_RELEASE, NULL); } - /* * Reset the metrics counters on the given disk. Note that we cannot * reset the busy counter, as it may case a panic in disk_unbusy(). diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 1525d8cda1b..a520ec759e2 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_subr.c,v 1.118 2005/11/18 13:25:40 pedro Exp $ */ +/* $OpenBSD: vfs_subr.c,v 1.119 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: vfs_subr.c,v 1.53 1996/04/22 01:39:13 christos Exp $ */ /* @@ -178,7 +178,7 @@ vfs_busy(struct mount *mp, int flags, struct simplelock *interlkp, if (interlkp) lkflags |= LK_INTERLOCK; - if (lockmgr(&mp->mnt_lock, lkflags, interlkp, p)) + if (lockmgr(&mp->mnt_lock, lkflags, interlkp)) return (ENOENT); return (0); } @@ -190,7 +190,7 @@ vfs_busy(struct mount *mp, int flags, struct simplelock *interlkp, void vfs_unbusy(struct mount *mp, struct proc *p) { - lockmgr(&mp->mnt_lock, LK_RELEASE, NULL, p); + lockmgr(&mp->mnt_lock, LK_RELEASE, NULL); } int diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 628fec33052..9a29d370473 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfs_syscalls.c,v 1.127 2005/11/08 15:43:44 pedro Exp $ */ +/* $OpenBSD: vfs_syscalls.c,v 1.128 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: vfs_syscalls.c,v 1.71 1996/04/23 10:29:02 mycroft Exp $ */ /* @@ -439,7 +439,7 @@ dounmount(struct mount *mp, int flags, struct proc *p, struct vnode *olddp) if ((mp->mnt_flag & MNT_RDONLY) == 0 && hadsyncer) (void) vfs_allocate_syncvnode(mp); lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, - &mountlist_slock, p); + &mountlist_slock); return (error); } CIRCLEQ_REMOVE(&mountlist, mp, mnt_list); @@ -450,7 +450,7 @@ dounmount(struct mount *mp, int flags, struct proc *p, struct vnode *olddp) mp->mnt_vfc->vfc_refcount--; if (!LIST_EMPTY(&mp->mnt_vnodelist)) panic("unmount: dangling vnode"); - lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_slock, p); + lockmgr(&mp->mnt_lock, LK_RELEASE | LK_INTERLOCK, &mountlist_slock); free(mp, M_MOUNT); return (0); } diff --git a/sys/miscfs/fdesc/fdesc_vnops.c b/sys/miscfs/fdesc/fdesc_vnops.c index ea3e16fb095..09895f70ba2 100644 --- a/sys/miscfs/fdesc/fdesc_vnops.c +++ b/sys/miscfs/fdesc/fdesc_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fdesc_vnops.c,v 1.37 2004/05/20 18:32:37 tedu Exp $ */ +/* $OpenBSD: fdesc_vnops.c,v 1.38 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: fdesc_vnops.c,v 1.32 1996/04/11 11:24:29 mrg Exp $ */ /* @@ -190,12 +190,12 @@ fdesc_allocvp(ftype, ix, mp, vpp) struct mount *mp; struct vnode **vpp; { - struct proc *p = curproc; /* XXX */ + struct proc *p = curproc; struct fdhashhead *fc; struct fdescnode *fd; int error = 0; - if ((error = lockmgr(&fdcache_lock, LK_EXCLUSIVE, NULL, p)) != 0) + if ((error = lockmgr(&fdcache_lock, LK_EXCLUSIVE, NULL)) != 0) return error; fc = FD_NHASH(ix); @@ -222,7 +222,7 @@ loop: LIST_INSERT_HEAD(fc, fd, fd_hash); out: - lockmgr(&fdcache_lock, LK_RELEASE, NULL, p); + lockmgr(&fdcache_lock, LK_RELEASE, NULL); return (error); } diff --git a/sys/miscfs/kernfs/kernfs_vnops.c b/sys/miscfs/kernfs/kernfs_vnops.c index 86a33926edf..ae31af46dfc 100644 --- a/sys/miscfs/kernfs/kernfs_vnops.c +++ b/sys/miscfs/kernfs/kernfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kernfs_vnops.c,v 1.42 2004/11/18 17:12:33 millert Exp $ */ +/* $OpenBSD: kernfs_vnops.c,v 1.43 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: kernfs_vnops.c,v 1.43 1996/03/16 23:52:47 christos Exp $ */ /* @@ -232,7 +232,7 @@ kernfs_allocvp(kt, mp, vpp) printf("kernfs_allocvp: looking for %s\n", kt->kt_name); #endif - if ((error = lockmgr(&kfscache_lock, LK_EXCLUSIVE, NULL, p)) != 0) + if ((error = lockmgr(&kfscache_lock, LK_EXCLUSIVE, NULL)) != 0) return(error); loop: @@ -266,7 +266,7 @@ loop: TAILQ_INSERT_TAIL(&kfshead, kf, list); out: - lockmgr(&kfscache_lock, LK_RELEASE, NULL, p); + lockmgr(&kfscache_lock, LK_RELEASE, NULL); #ifdef KERNFS_DIAGNOSTIC if (error) diff --git a/sys/miscfs/procfs/procfs_subr.c b/sys/miscfs/procfs/procfs_subr.c index ea58588ee0b..5826d25f5c5 100644 --- a/sys/miscfs/procfs/procfs_subr.c +++ b/sys/miscfs/procfs/procfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: procfs_subr.c,v 1.22 2005/04/16 22:19:28 kettenis Exp $ */ +/* $OpenBSD: procfs_subr.c,v 1.23 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: procfs_subr.c,v 1.15 1996/02/12 15:01:42 christos Exp $ */ /* @@ -102,7 +102,7 @@ procfs_allocvp(mp, vpp, pid, pfs_type) /* * Lock the vp list, getnewvnode can sleep. */ - error = lockmgr(&pfs_vlock, LK_EXCLUSIVE, NULL, p); + error = lockmgr(&pfs_vlock, LK_EXCLUSIVE, NULL); if (error) return (error); loop: @@ -180,7 +180,7 @@ loop: TAILQ_INSERT_TAIL(&pfshead, pfs, list); uvm_vnp_setsize(vp, 0); out: - lockmgr(&pfs_vlock, LK_RELEASE, NULL, p); + lockmgr(&pfs_vlock, LK_RELEASE, NULL); return (error); } diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index 578a25d23e3..29b0a7f29e0 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.54 2005/10/08 09:38:22 tom Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.55 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -1743,8 +1743,7 @@ msdosfs_lock(v) } */ *ap = v; struct vnode *vp = ap->a_vp; - return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, &vp->v_interlock, - ap->a_p)); + return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, &vp->v_interlock)); } int @@ -1757,7 +1756,7 @@ msdosfs_unlock(v) struct vnode *vp = ap->a_vp; return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + &vp->v_interlock)); } int diff --git a/sys/nfs/nfs_kq.c b/sys/nfs/nfs_kq.c index d8919486392..3961f913405 100644 --- a/sys/nfs/nfs_kq.c +++ b/sys/nfs/nfs_kq.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_kq.c,v 1.1 2004/07/21 17:30:56 marius Exp $ */ +/* $OpenBSD: nfs_kq.c,v 1.2 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: nfs_kq.c,v 1.7 2003/10/30 01:43:10 simonb Exp $ */ /*- @@ -109,7 +109,7 @@ nfs_kqpoll(void *arg) u_quad_t osize; for(;;) { - lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL); SLIST_FOREACH(ke, &kevlist, kev_link) { struct nfsnode *np = VTONFS(ke->vp); @@ -126,7 +126,7 @@ nfs_kqpoll(void *arg) * for changes. */ ke->flags |= KEVQ_BUSY; - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); /* save v_size, nfs_getattr() updates it */ osize = np->n_size; @@ -157,7 +157,7 @@ nfs_kqpoll(void *arg) ke->onlink = attr.va_nlink; } - lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL); ke->flags &= ~KEVQ_BUSY; if (ke->flags & KEVQ_WANT) { ke->flags &= ~KEVQ_WANT; @@ -168,10 +168,10 @@ nfs_kqpoll(void *arg) if (SLIST_EMPTY(&kevlist)) { /* Nothing more to watch, exit */ pnfskq = NULL; - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); kthread_exit(0); } - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); /* wait a while before checking for changes again */ tsleep(pnfskq, PSOCK, "nfskqpw", @@ -185,7 +185,6 @@ filt_nfsdetach(struct knote *kn) { struct vnode *vp = (struct vnode *)kn->kn_hook; struct kevq *ke; - struct proc *p = curproc; #ifdef notyet /* XXXLUKEM lock the struct? */ @@ -198,14 +197,14 @@ filt_nfsdetach(struct knote *kn) simple_unlock(&vp->v_selectinfo.vsi_lock); /* Remove the vnode from watch list */ - lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL); SLIST_FOREACH(ke, &kevlist, kev_link) { if (ke->vp == vp) { while (ke->flags & KEVQ_BUSY) { ke->flags |= KEVQ_WANT; - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); (void) tsleep(ke, PSOCK, "nfskqdet", 0); - lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL); } if (ke->usecount > 1) { @@ -219,7 +218,7 @@ filt_nfsdetach(struct knote *kn) break; } } - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); } static int @@ -310,7 +309,7 @@ nfs_kqfilter(void *v) memset(&attr, 0, sizeof(attr)); (void) VOP_GETATTR(vp, &attr, p->p_ucred, p); - lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&nfskevq_lock, LK_EXCLUSIVE, NULL); /* ensure the poller is running */ if (!pnfskq) { @@ -353,7 +352,7 @@ nfs_kqfilter(void *v) #endif out: - lockmgr(&nfskevq_lock, LK_RELEASE, NULL, p); + lockmgr(&nfskevq_lock, LK_RELEASE, NULL); return (error); } diff --git a/sys/nfs/nfs_node.c b/sys/nfs/nfs_node.c index 4378ad6aa2e..dee55c1c4dc 100644 --- a/sys/nfs/nfs_node.c +++ b/sys/nfs/nfs_node.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_node.c,v 1.28 2004/12/26 21:22:13 miod Exp $ */ +/* $OpenBSD: nfs_node.c,v 1.29 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: nfs_node.c,v 1.16 1996/02/18 11:53:42 fvdl Exp $ */ /* @@ -114,12 +114,12 @@ loop: *npp = np; return(0); } - if (lockmgr(&nfs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, NULL, p)) + if (lockmgr(&nfs_hashlock, LK_EXCLUSIVE|LK_SLEEPFAIL, NULL)) goto loop; error = getnewvnode(VT_NFS, mntp, nfsv2_vnodeop_p, &nvp); if (error) { *npp = 0; - lockmgr(&nfs_hashlock, LK_RELEASE, NULL, p); + lockmgr(&nfs_hashlock, LK_RELEASE, NULL); return (error); } vp = nvp; @@ -151,7 +151,7 @@ loop: np->n_fhp = &np->n_fh; bcopy((caddr_t)fhp, (caddr_t)np->n_fhp, fhsize); np->n_fhsize = fhsize; - lockmgr(&nfs_hashlock, LK_RELEASE, 0, p); + lockmgr(&nfs_hashlock, LK_RELEASE, 0); *npp = np; return (0); } diff --git a/sys/ntfs/ntfs_subr.c b/sys/ntfs/ntfs_subr.c index 2e0689df8d1..3d2699ee398 100644 --- a/sys/ntfs/ntfs_subr.c +++ b/sys/ntfs/ntfs_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_subr.c,v 1.7 2005/05/24 05:43:31 brad Exp $ */ +/* $OpenBSD: ntfs_subr.c,v 1.8 2005/11/19 02:18:01 pedro Exp $ */ /* $NetBSD: ntfs_subr.c,v 1.4 2003/04/10 21:37:32 jdolecek Exp $ */ /*- @@ -394,11 +394,8 @@ ntfs_ntget( simple_lock(&ip->i_interlock); ip->i_usecount++; -#ifndef __OpenBSD__ + lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock); -#else - lockmgr(&ip->i_lock, LK_EXCLUSIVE | LK_INTERLOCK, &ip->i_interlock, p); -#endif return 0; } @@ -437,11 +434,7 @@ ntfs_ntlookup( *ipp = ip; return (0); } -#ifndef __OpenBSD__ } while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL)); -#else - } while (lockmgr(&ntfs_hashlock, LK_EXCLUSIVE | LK_SLEEPFAIL, NULL, p)); -#endif MALLOC(ip, struct ntnode *, sizeof(struct ntnode), M_NTFSNTNODE, M_WAITOK); @@ -468,11 +461,7 @@ ntfs_ntlookup( ntfs_nthashins(ip); -#ifndef __OpenBSD__ lockmgr(&ntfs_hashlock, LK_RELEASE, NULL); -#else - lockmgr(&ntfs_hashlock, LK_RELEASE, NULL, p); -#endif *ipp = ip; @@ -512,11 +501,7 @@ ntfs_ntput( #endif if (ip->i_usecount > 0) { -#ifndef __OpenBSD__ lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock); -#else - lockmgr(&ip->i_lock, LK_RELEASE|LK_INTERLOCK, &ip->i_interlock, p); -#endif return; } @@ -2111,12 +2096,8 @@ ntfs_toupper_use(mp, ntmp, p) struct vnode *vp; /* get exclusive access */ -#ifndef __OpenBSD__ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL); -#else - lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, p); -#endif - + /* only read the translation data from a file if it hasn't been * read already */ if (ntfs_toupper_tab) @@ -2139,11 +2120,7 @@ ntfs_toupper_use(mp, ntmp, p) out: ntfs_toupper_usecount++; -#ifndef __OpenBSD__ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL); -#else - lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, p); -#endif return (error); } @@ -2160,11 +2137,7 @@ ntfs_toupper_unuse(p) #endif { /* get exclusive access */ -#ifndef __OpenBSD__ lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL); -#else - lockmgr(&ntfs_toupper_lock, LK_EXCLUSIVE, NULL, p); -#endif ntfs_toupper_usecount--; if (ntfs_toupper_usecount == 0) { @@ -2179,9 +2152,5 @@ ntfs_toupper_unuse(p) #endif /* release the lock */ -#ifndef __OpenBSD__ lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL); -#else - lockmgr(&ntfs_toupper_lock, LK_RELEASE, NULL, p); -#endif -} +} diff --git a/sys/scsi/safte.c b/sys/scsi/safte.c index b490ecbd43d..1a6e4a5a28d 100644 --- a/sys/scsi/safte.c +++ b/sys/scsi/safte.c @@ -1,4 +1,4 @@ -/* $OpenBSD: safte.c,v 1.22 2005/11/13 02:26:48 dlg Exp $ */ +/* $OpenBSD: safte.c,v 1.23 2005/11/19 02:18:01 pedro Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -211,7 +211,7 @@ safte_detach(struct device *self, int flags) struct safte_softc *sc = (struct safte_softc *)self; int i; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); #if NBIO > 0 if (sc->sc_nslots > 0) @@ -232,8 +232,8 @@ safte_detach(struct device *self, int flags) if (sc->sc_encbuf != NULL) free(sc->sc_encbuf, M_DEVBUF); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); - lockmgr(&sc->sc_lock, LK_DRAIN, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); + lockmgr(&sc->sc_lock, LK_DRAIN, NULL); return (0); } @@ -383,7 +383,7 @@ safte_read_encstat(void *arg) struct safte_sensor *s; u_int16_t oot; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); memset(&cmd, 0, sizeof(cmd)); cmd.opcode = READ_BUFFER; @@ -401,7 +401,7 @@ safte_read_encstat(void *arg) if (scsi_scsi_cmd(sc->sc_link, (struct scsi_generic *)&cmd, sizeof(cmd), sc->sc_encbuf, sc->sc_encbuflen, 2, 30000, NULL, flags) != 0) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); printf("%s: unable to read enclosure status\n", DEVNAME(sc)); return; } @@ -504,7 +504,7 @@ safte_read_encstat(void *arg) sc->sc_temps[i].se_sensor.status = (oot & (1 << i)) ? SENSOR_S_CRIT : SENSOR_S_OK; - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); } #if NBIO > 0 @@ -547,12 +547,12 @@ safte_bio_blink(struct safte_softc *sc, struct bioc_blink *blink) return (EINVAL); } - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); for (slot = 0; slot < sc->sc_nslots; slot++) { if (sc->sc_slots[slot] == blink->bb_target) break; } - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); if (slot >= sc->sc_nslots) return (ENODEV); diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c index fd24e85067c..bd61a8df224 100644 --- a/sys/scsi/ses.c +++ b/sys/scsi/ses.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ses.c,v 1.31 2005/11/13 02:38:27 dlg Exp $ */ +/* $OpenBSD: ses.c,v 1.32 2005/11/19 02:18:01 pedro Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -212,7 +212,7 @@ ses_detach(struct device *self, int flags) struct ses_slot *slot; #endif - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); #if NBIO > 0 if (!TAILQ_EMPTY(&sc->sc_slots)) { @@ -239,8 +239,8 @@ ses_detach(struct device *self, int flags) if (sc->sc_buf != NULL) free(sc->sc_buf, M_DEVBUF); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); - lockmgr(&sc->sc_lock, LK_DRAIN, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); + lockmgr(&sc->sc_lock, LK_DRAIN, NULL); return (0); } @@ -496,11 +496,11 @@ ses_refresh_sensors(void *arg) struct ses_sensor *sensor; int ret = 0; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); if (ses_read_status(sc) != 0) { printf("%s: unable to read enclosure status\n", DEVNAME(sc)); - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return; } @@ -550,7 +550,7 @@ ses_refresh_sensors(void *arg) } } - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); if (ret) printf("%s: error in sensor data\n"); @@ -606,10 +606,10 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) { struct ses_slot *slot; - lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_EXCLUSIVE, NULL); if (ses_read_status(sc) != 0) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (EIO); } @@ -619,7 +619,7 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) } if (slot == TAILQ_END(&sc->sc_slots)) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (EINVAL); } @@ -641,7 +641,7 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) break; default: - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (EINVAL); } @@ -650,11 +650,11 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) slot->sl_stat->f3); if (ses_write_config(sc) != 0) { - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (EIO); } - lockmgr(&sc->sc_lock, LK_RELEASE, NULL, curproc); + lockmgr(&sc->sc_lock, LK_RELEASE, NULL); return (0); } diff --git a/sys/sys/lock.h b/sys/sys/lock.h index 09bbe8573b9..c3453ae6d60 100644 --- a/sys/sys/lock.h +++ b/sys/sys/lock.h @@ -1,4 +1,4 @@ -/* $OpenBSD: lock.h,v 1.14 2005/05/29 03:20:42 deraadt Exp $ */ +/* $OpenBSD: lock.h,v 1.15 2005/11/19 02:18:01 pedro Exp $ */ /* * Copyright (c) 1995 @@ -205,8 +205,7 @@ struct proc; void lockinit(struct lock *, int prio, char *wmesg, int timo, int flags); -int lockmgr(__volatile struct lock *, u_int flags, - struct simplelock *, struct proc *p); +int lockmgr(__volatile struct lock *, u_int flags, struct simplelock *); void lockmgr_printinfo(__volatile struct lock *); int lockstatus(struct lock *); @@ -214,7 +213,7 @@ int lockstatus(struct lock *); #define spinlockinit(lkp, name, flags) \ lockinit((lkp), 0, (name), 0, (flags) | LK_SPIN) #define spinlockmgr(lkp, flags, intrlk) \ - lockmgr((lkp), (flags) | LK_SPIN, (intrlk), curproc) + lockmgr((lkp), (flags) | LK_SPIN, (intrlk)) #else #define spinlockinit(lkp, name, flags) (void)(lkp) #define spinlockmgr(lkp, flags, intrlk) (0) diff --git a/sys/ufs/ufs/ufs_ihash.c b/sys/ufs/ufs/ufs_ihash.c index d8b8354232d..6d6beb4c6a2 100644 --- a/sys/ufs/ufs/ufs_ihash.c +++ b/sys/ufs/ufs/ufs_ihash.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_ihash.c,v 1.11 2005/11/10 22:01:14 pedro Exp $ */ +/* $OpenBSD: ufs_ihash.c,v 1.12 2005/11/19 02:18:02 pedro Exp $ */ /* $NetBSD: ufs_ihash.c,v 1.3 1996/02/09 22:36:04 christos Exp $ */ /* @@ -114,20 +114,19 @@ int ufs_ihashins(struct inode *ip) { struct inode *curip; - struct proc *p = curproc; struct ihashhead *ipp; dev_t dev = ip->i_dev; ino_t inum = ip->i_number; /* lock the inode, then put it on the appropriate hash list */ - lockmgr(&ip->i_lock, LK_EXCLUSIVE, (struct simplelock *)0, p); + lockmgr(&ip->i_lock, LK_EXCLUSIVE, NULL); simple_lock(&ufs_ihash_slock); LIST_FOREACH(curip, INOHASH(dev, inum), i_hash) { if (inum == curip->i_number && dev == curip->i_dev) { simple_unlock(&ufs_ihash_slock); - lockmgr(&ip->i_lock, LK_RELEASE, (struct simplelock *)0, p); + lockmgr(&ip->i_lock, LK_RELEASE, NULL); return (EEXIST); } } diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index a359abbc514..ae0455a7bc3 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ufs_vnops.c,v 1.68 2005/11/11 16:27:52 pedro Exp $ */ +/* $OpenBSD: ufs_vnops.c,v 1.69 2005/11/19 02:18:02 pedro Exp $ */ /* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */ /* @@ -1614,8 +1614,7 @@ ufs_lock(void *v) } */ *ap = v; struct vnode *vp = ap->a_vp; - return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock, - ap->a_p)); + return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags, &vp->v_interlock)); } /* @@ -1632,7 +1631,7 @@ ufs_unlock(void *v) struct vnode *vp = ap->a_vp; return (lockmgr(&VTOI(vp)->i_lock, ap->a_flags | LK_RELEASE, - &vp->v_interlock, ap->a_p)); + &vp->v_interlock)); } /* diff --git a/sys/uvm/uvm_map.h b/sys/uvm/uvm_map.h index e729e609300..2db836338b3 100644 --- a/sys/uvm/uvm_map.h +++ b/sys/uvm/uvm_map.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_map.h,v 1.33 2005/09/30 02:42:57 brad Exp $ */ +/* $OpenBSD: uvm_map.h,v 1.34 2005/11/19 02:18:02 pedro Exp $ */ /* $NetBSD: uvm_map.h,v 1.24 2001/02/18 21:19:08 chs Exp $ */ /* @@ -410,7 +410,7 @@ vm_map_lock_try(map) return (FALSE); } rv = (lockmgr(&map->lock, LK_EXCLUSIVE|LK_NOWAIT|LK_INTERLOCK, - &map->flags_lock, curproc) == 0); + &map->flags_lock) == 0); } if (rv) @@ -438,7 +438,7 @@ vm_map_lock(map) } error = lockmgr(&map->lock, LK_EXCLUSIVE|LK_SLEEPFAIL|LK_INTERLOCK, - &map->flags_lock, curproc); + &map->flags_lock); if (error) { goto try_again; @@ -452,11 +452,11 @@ vm_map_lock(map) do { \ if (map->flags & VM_MAP_INTRSAFE) \ panic("vm_map_lock_read: intrsafe map"); \ - (void) lockmgr(&(map)->lock, LK_SHARED, NULL, curproc); \ + (void) lockmgr(&(map)->lock, LK_SHARED, NULL); \ } while (0) #else #define vm_map_lock_read(map) \ - (void) lockmgr(&(map)->lock, LK_SHARED, NULL, curproc) + (void) lockmgr(&(map)->lock, LK_SHARED, NULL) #endif #define vm_map_unlock(map) \ @@ -464,24 +464,24 @@ do { \ if ((map)->flags & VM_MAP_INTRSAFE) \ simple_unlock(&(map)->lock.lk_interlock); \ else \ - (void) lockmgr(&(map)->lock, LK_RELEASE, NULL, curproc);\ + (void) lockmgr(&(map)->lock, LK_RELEASE, NULL); \ } while (0) #define vm_map_unlock_read(map) \ - (void) lockmgr(&(map)->lock, LK_RELEASE, NULL, curproc) + (void) lockmgr(&(map)->lock, LK_RELEASE, NULL) #define vm_map_downgrade(map) \ - (void) lockmgr(&(map)->lock, LK_DOWNGRADE, NULL, curproc) + (void) lockmgr(&(map)->lock, LK_DOWNGRADE, NULL) #ifdef DIAGNOSTIC #define vm_map_upgrade(map) \ do { \ - if (lockmgr(&(map)->lock, LK_UPGRADE, NULL, curproc) != 0) \ + if (lockmgr(&(map)->lock, LK_UPGRADE, NULL) != 0) \ panic("vm_map_upgrade: failed to upgrade lock"); \ } while (0) #else #define vm_map_upgrade(map) \ - (void) lockmgr(&(map)->lock, LK_UPGRADE, NULL, curproc) + (void) lockmgr(&(map)->lock, LK_UPGRADE, NULL) #endif #define vm_map_busy(map) \ diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c index a0c0d55f1c6..ad60d4a692c 100644 --- a/sys/uvm/uvm_swap.c +++ b/sys/uvm/uvm_swap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_swap.c,v 1.60 2004/12/26 21:22:14 miod Exp $ */ +/* $OpenBSD: uvm_swap.c,v 1.61 2005/11/19 02:18:02 pedro Exp $ */ /* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */ /* @@ -638,7 +638,7 @@ sys_swapctl(p, v, retval) /* * ensure serialized syscall access by grabbing the swap_syscall_lock */ - lockmgr(&swap_syscall_lock, LK_EXCLUSIVE, NULL, p); + lockmgr(&swap_syscall_lock, LK_EXCLUSIVE, NULL); /* * we handle the non-priv NSWAP and STATS request first. @@ -877,7 +877,7 @@ sys_swapctl(p, v, retval) vput(vp); out: - lockmgr(&swap_syscall_lock, LK_RELEASE, NULL, p); + lockmgr(&swap_syscall_lock, LK_RELEASE, NULL); UVMHIST_LOG(pdhist, "<- done! error=%d", error, 0, 0, 0); return (error); diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index 83f7c85f544..58715206ed8 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_vnode.c,v 1.39 2004/12/26 21:22:14 miod Exp $ */ +/* $OpenBSD: uvm_vnode.c,v 1.40 2005/11/19 02:18:02 pedro Exp $ */ /* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */ /* @@ -1930,7 +1930,7 @@ uvm_vnp_sync(mp) * step 1: ensure we are only ones using the uvn_sync_q by locking * our lock... */ - lockmgr(&uvn_sync_lock, LK_EXCLUSIVE, NULL, curproc); + lockmgr(&uvn_sync_lock, LK_EXCLUSIVE, NULL); /* * step 2: build up a simpleq of uvns of interest based on the @@ -2025,5 +2025,5 @@ uvm_vnp_sync(mp) /* * done! release sync lock */ - lockmgr(&uvn_sync_lock, LK_RELEASE, (void *)0, curproc); + lockmgr(&uvn_sync_lock, LK_RELEASE, NULL); } diff --git a/sys/xfs/xfs_config.h b/sys/xfs/xfs_config.h index 034e409a61d..57cf01c741e 100644 --- a/sys/xfs/xfs_config.h +++ b/sys/xfs/xfs_config.h @@ -225,7 +225,7 @@ static /**/const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } #define HAVE_FNMATCH_H 1 /* define if lockmgr takes four arguments */ -#define HAVE_FOUR_ARGUMENT_LOCKMGR 1 +/* #undef HAVE_FOUR_ARGUMENT_LOCKMGR */ /* define if vfs_busy takes four arguments */ #define HAVE_FOUR_ARGUMENT_VFS_BUSY 1 |