Remove LOCK_ASSERT(!simple_lock_held(&foo));

This commit is contained in:
ad 2007-10-11 19:53:37 +00:00
parent 112ca87c2d
commit 4c92a21547
7 changed files with 15 additions and 28 deletions

View File

@ -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 <sys/cdefs.h>
__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);
}

View File

@ -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 <sys/cdefs.h>
__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

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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.

View File

@ -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 <sys/cdefs.h>
__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

View File

@ -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 <sys/cdefs.h>
__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;

View File

@ -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 <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/systm.h>
@ -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) {

View File

@ -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 <sys/cdefs.h>
__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;
}