From 4c92a215478dc961179a1ccb5081f28e2072293d Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 11 Oct 2007 19:53:37 +0000 Subject: [PATCH] Remove LOCK_ASSERT(!simple_lock_held(&foo)); --- sys/kern/subr_pool.c | 8 ++------ sys/kern/vfs_subr.c | 5 ++--- sys/ufs/lfs/lfs_bio.c | 6 ++---- sys/uvm/uvm_anon.c | 5 ++--- sys/uvm/uvm_fault.c | 5 ++--- sys/uvm/uvm_loan.c | 6 ++---- sys/uvm/uvm_vnode.c | 8 +++----- 7 files changed, 15 insertions(+), 28 deletions(-) diff --git a/sys/kern/subr_pool.c b/sys/kern/subr_pool.c index fb130ba67699..80278c8f2a2e 100644 --- a/sys/kern/subr_pool.c +++ b/sys/kern/subr_pool.c @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.132 2007/10/11 19:45:25 ad Exp $ */ +/* $NetBSD: subr_pool.c,v 1.133 2007/10/11 19:53:37 ad Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.132 2007/10/11 19:45:25 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.133 2007/10/11 19:53:37 ad Exp $"); #include "opt_pool.h" #include "opt_poollog.h" @@ -2353,8 +2353,6 @@ pool_allocator_alloc(struct pool *pp, int flags) struct pool_allocator *pa = pp->pr_alloc; void *res; - LOCK_ASSERT(!simple_lock_held(&pp->pr_slock)); - res = (*pa->pa_alloc)(pp, flags); if (res == NULL && (flags & PR_WAITOK) == 0) { /* @@ -2375,8 +2373,6 @@ pool_allocator_free(struct pool *pp, void *v) { struct pool_allocator *pa = pp->pr_alloc; - LOCK_ASSERT(!simple_lock_held(&pp->pr_slock)); - (*pa->pa_free)(pp, v); } diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 2982e14bf481..14588be2db90 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.302 2007/10/10 20:42:27 ad Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.303 2007/10/11 19:53:42 ad Exp $ */ /*- * Copyright (c) 1997, 1998, 2004, 2005, 2007 The NetBSD Foundation, Inc. @@ -82,7 +82,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.302 2007/10/10 20:42:27 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_subr.c,v 1.303 2007/10/11 19:53:42 ad Exp $"); #include "opt_inet.h" #include "opt_ddb.h" @@ -1111,7 +1111,6 @@ vclean(struct vnode *vp, int flags, struct lwp *l) vp->v_specinfo = NULL; } } - LOCK_ASSERT(!simple_lock_held(&vp->v_interlock)); /* * If purging an active vnode, it must be closed and diff --git a/sys/ufs/lfs/lfs_bio.c b/sys/ufs/lfs/lfs_bio.c index dfffd3129f02..3ae40e4d8204 100644 --- a/sys/ufs/lfs/lfs_bio.c +++ b/sys/ufs/lfs/lfs_bio.c @@ -1,4 +1,4 @@ -/* $NetBSD: lfs_bio.c,v 1.105 2007/10/10 20:42:34 ad Exp $ */ +/* $NetBSD: lfs_bio.c,v 1.106 2007/10/11 19:53:43 ad Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc. @@ -67,7 +67,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.105 2007/10/10 20:42:34 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.106 2007/10/11 19:53:43 ad Exp $"); #include #include @@ -519,7 +519,6 @@ lfs_flush_fs(struct lfs *fs, int flags) { ASSERT_NO_SEGLOCK(fs); LOCK_ASSERT(simple_lock_held(&fs->lfs_interlock)); - LOCK_ASSERT(!simple_lock_held(&lfs_subsys_lock)); if (fs->lfs_ronly) return; @@ -641,7 +640,6 @@ lfs_check(struct vnode *vp, daddr_t blkno, int flags) fs = ip->i_lfs; ASSERT_NO_SEGLOCK(fs); - LOCK_ASSERT(!simple_lock_held(&fs->lfs_interlock)); /* * If we would flush below, but dirops are active, sleep. diff --git a/sys/uvm/uvm_anon.c b/sys/uvm/uvm_anon.c index 969b26e5551f..92dff385f71d 100644 --- a/sys/uvm/uvm_anon.c +++ b/sys/uvm/uvm_anon.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_anon.c,v 1.45 2007/07/21 19:21:53 ad Exp $ */ +/* $NetBSD: uvm_anon.c,v 1.46 2007/10/11 19:53:43 ad Exp $ */ /* * @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.45 2007/07/21 19:21:53 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_anon.c,v 1.46 2007/10/11 19:53:43 ad Exp $"); #include "opt_uvmhist.h" @@ -125,7 +125,6 @@ uvm_anfree(struct vm_anon *anon) UVMHIST_LOG(maphist,"(anon=0x%x)", anon, 0,0,0); KASSERT(anon->an_ref == 0); - LOCK_ASSERT(!simple_lock_held(&anon->an_lock)); /* * get page diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c index 06c4665eba0f..35492408cea1 100644 --- a/sys/uvm/uvm_fault.c +++ b/sys/uvm/uvm_fault.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_fault.c,v 1.120 2007/07/21 19:21:54 ad Exp $ */ +/* $NetBSD: uvm_fault.c,v 1.121 2007/10/11 19:53:43 ad Exp $ */ /* * @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.120 2007/07/21 19:21:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_fault.c,v 1.121 2007/10/11 19:53:43 ad Exp $"); #include "opt_uvmhist.h" @@ -585,7 +585,6 @@ uvmfault_promote(struct uvm_faultinfo *ufi, KASSERT(mutex_owned(&amap->am_l)); LOCK_ASSERT(oanon == NULL || simple_lock_held(&oanon->an_lock)); LOCK_ASSERT(uobj == NULL || simple_lock_held(&uobj->vmobjlock)); - LOCK_ASSERT(*spare == NULL || !simple_lock_held(&(*spare)->an_lock)); if (*spare != NULL) { anon = *spare; diff --git a/sys/uvm/uvm_loan.c b/sys/uvm/uvm_loan.c index d8072a3a414e..d95395b4241d 100644 --- a/sys/uvm/uvm_loan.c +++ b/sys/uvm/uvm_loan.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_loan.c,v 1.66 2007/07/21 19:21:54 ad Exp $ */ +/* $NetBSD: uvm_loan.c,v 1.67 2007/10/11 19:53:43 ad Exp $ */ /* * @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.66 2007/07/21 19:21:54 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_loan.c,v 1.67 2007/10/11 19:53:43 ad Exp $"); #include #include @@ -185,8 +185,6 @@ uvm_loanentry(struct uvm_faultinfo *ufi, void ***output, int flags) /* locked: if (rv > 0) => map, amap, uobj [o.w. unlocked] */ KASSERT(rv > 0 || aref->ar_amap == NULL || !mutex_owned(&aref->ar_amap->am_l)); - LOCK_ASSERT(rv > 0 || uobj == NULL || - !simple_lock_held(&uobj->vmobjlock)); /* total failure */ if (rv < 0) { diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c index 75f98eaac97d..06a8d47b050b 100644 --- a/sys/uvm/uvm_vnode.c +++ b/sys/uvm/uvm_vnode.c @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_vnode.c,v 1.86 2007/10/10 20:42:41 ad Exp $ */ +/* $NetBSD: uvm_vnode.c,v 1.87 2007/10/11 19:53:43 ad Exp $ */ /* * Copyright (c) 1997 Charles D. Cranor and Washington University. @@ -50,7 +50,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.86 2007/10/10 20:42:41 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: uvm_vnode.c,v 1.87 2007/10/11 19:53:43 ad Exp $"); #include "fs_nfs.h" #include "opt_uvmhist.h" @@ -152,7 +152,6 @@ uvn_put(struct uvm_object *uobj, voff_t offlo, voff_t offhi, int flags) LOCK_ASSERT(simple_lock_held(&vp->v_interlock)); error = VOP_PUTPAGES(vp, offlo, offhi, flags); - LOCK_ASSERT(!simple_lock_held(&vp->v_interlock)); return error; } @@ -194,8 +193,7 @@ uvn_get(struct uvm_object *uobj, voff_t offset, LOCK_ASSERT(((flags & PGO_LOCKED) != 0 && simple_lock_held(&vp->v_interlock)) || - ((flags & PGO_LOCKED) == 0 && - !simple_lock_held(&vp->v_interlock))); + (flags & PGO_LOCKED) == 0); return error; }