Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/puffs Remove #ifdef DIAGNOSTIC guards around KASSERT, ...
details: https://anonhg.NetBSD.org/src/rev/ee704cd0840b
branches: trunk
changeset: 770497:ee704cd0840b
user: manu <manu%NetBSD.org@localhost>
date: Wed Oct 19 01:39:29 2011 +0000
description:
Remove #ifdef DIAGNOSTIC guards around KASSERT, as the macro contains them
diffstat:
sys/fs/puffs/puffs_msgif.c | 19 +++++--------------
sys/fs/puffs/puffs_node.c | 6 ++----
sys/fs/puffs/puffs_vfsops.c | 8 ++------
sys/fs/puffs/puffs_vnops.c | 16 ++++------------
4 files changed, 13 insertions(+), 36 deletions(-)
diffs (181 lines):
diff -r 3863ecabfadb -r ee704cd0840b sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c Wed Oct 19 01:34:37 2011 +0000
+++ b/sys/fs/puffs/puffs_msgif.c Wed Oct 19 01:39:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $ */
+/* $NetBSD: puffs_msgif.c,v 1.89 2011/10/19 01:39:29 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.88 2011/10/18 15:39:09 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.89 2011/10/19 01:39:29 manu Exp $");
#include <sys/param.h>
#include <sys/atomic.h>
@@ -134,10 +134,8 @@
{
struct puffs_msgpark *park;
-#ifdef DIAGNOSTIC
- if (curlwp == uvm.pagedaemon_lwp)
- KASSERT(!waitok);
-#endif
+ KASSERT(curlwp != uvm.pagedaemon_lwp || !waitok);
+
park = pool_cache_get(parkpc, waitok ? PR_WAITOK : PR_NOWAIT);
if (park == NULL)
return park;
@@ -238,10 +236,7 @@
struct puffs_msgpark *park;
void *m;
-#ifdef DIAGNOSTIC
- if (curlwp == uvm.pagedaemon_lwp)
- KASSERT(!cansleep);
-#endif
+ KASSERT(curlwp != uvm.pagedaemon_lwp || !cansleep);
m = kmem_zalloc(len, cansleep ? KM_SLEEP : KM_NOSLEEP);
if (m == NULL) {
KASSERT(cansleep == 0);
@@ -960,9 +955,7 @@
}
pf = (struct puffs_flush *)preq;
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
memcpy(&psopr->psopr_pf, pf, sizeof(*pf));
psopr->psopr_sopreq = PUFFS_SOPREQ_FLUSH;
@@ -986,9 +979,7 @@
DPRINTF(("dispatch: unmount 0x%x\n", preq->preq_optype));
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
psopr->psopr_preq = *preq;
psopr->psopr_sopreq = PUFFS_SOPREQ_UNMOUNT;
diff -r 3863ecabfadb -r ee704cd0840b sys/fs/puffs/puffs_node.c
--- a/sys/fs/puffs/puffs_node.c Wed Oct 19 01:34:37 2011 +0000
+++ b/sys/fs/puffs/puffs_node.c Wed Oct 19 01:39:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $ */
+/* $NetBSD: puffs_node.c,v 1.22 2011/10/19 01:39:29 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.21 2011/10/18 15:39:09 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_node.c,v 1.22 2011/10/19 01:39:29 manu Exp $");
#include <sys/param.h>
#include <sys/hash.h>
@@ -231,9 +231,7 @@
}
}
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
pnc = kmem_alloc(sizeof(struct puffs_newcookie), KM_SLEEP);
pnc->pnc_cookie = ck;
LIST_INSERT_HEAD(&pmp->pmp_newcookie, pnc, pnc_entries);
diff -r 3863ecabfadb -r ee704cd0840b sys/fs/puffs/puffs_vfsops.c
--- a/sys/fs/puffs/puffs_vfsops.c Wed Oct 19 01:34:37 2011 +0000
+++ b/sys/fs/puffs/puffs_vfsops.c Wed Oct 19 01:39:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $ */
+/* $NetBSD: puffs_vfsops.c,v 1.100 2011/10/19 01:39:29 manu Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.99 2011/10/18 15:39:09 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vfsops.c,v 1.100 2011/10/19 01:39:29 manu Exp $");
#include <sys/param.h>
#include <sys/mount.h>
@@ -235,9 +235,7 @@
copy_statvfs_info(&args->pa_svfsb, mp);
(void)memcpy(&mp->mnt_stat, &args->pa_svfsb, sizeof(mp->mnt_stat));
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
pmp = kmem_zalloc(sizeof(struct puffs_mount), KM_SLEEP);
mp->mnt_fs_bshift = DEV_BSHIFT;
@@ -419,9 +417,7 @@
* Release kernel thread now that there is nothing
* it would be wanting to lock.
*/
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
psopr = kmem_alloc(sizeof(*psopr), KM_SLEEP);
psopr->psopr_sopreq = PUFFS_SOPREQSYS_EXIT;
mutex_enter(&pmp->pmp_sopmtx);
diff -r 3863ecabfadb -r ee704cd0840b sys/fs/puffs/puffs_vnops.c
--- a/sys/fs/puffs/puffs_vnops.c Wed Oct 19 01:34:37 2011 +0000
+++ b/sys/fs/puffs/puffs_vnops.c Wed Oct 19 01:39:29 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: puffs_vnops.c,v 1.159 2011/10/18 15:39:09 manu Exp $ */
+/* $NetBSD: puffs_vnops.c,v 1.160 2011/10/19 01:39:29 manu Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.159 2011/10/18 15:39:09 manu Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.160 2011/10/19 01:39:29 manu Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@@ -1243,9 +1243,7 @@
/* provide cookies to caller if so desired */
if (ap->a_cookies) {
-#ifdef DIAGNOSTIC
KASSERT(curlwp != uvm.pagedaemon_lwp);
-#endif
*ap->a_cookies = malloc(readdir_msg->pvnr_ncookies*CSIZE,
M_TEMP, M_WAITOK);
*ap->a_ncookies = readdir_msg->pvnr_ncookies;
@@ -2268,10 +2266,7 @@
cansleep = (curlwp == uvm.pagedaemon_lwp || dofaf) ? 0 : 1;
-#ifdef DIAGNOSTIC
- if (curlwp == uvm.pagedaemon_lwp)
- KASSERT(dofaf || BIOASYNC(bp));
-#endif
+ KASSERT(curlwp != uvm.pagedaemon_lwp || dofaf || BIOASYNC(bp));
/* allocate transport structure */
tomove = PUFFS_TOMOVE(bp->b_bcount, pmp);
@@ -2537,10 +2532,7 @@
#ifdef notnowjohn
/* allocate worst-case memory */
runsizes = ((npages / 2) + 1) * sizeof(struct puffs_cacherun);
-#ifdef DIAGNOSTIC
- if (curlwp == uvm.pagedaemon_lwp)
- KASSERT(locked);
-#endif
+ KASSERT(curlwp != uvm.pagedaemon_lwp || locked);
pcinfo = kmem_zalloc(sizeof(struct puffs_cacheinfo) + runsize,
locked ? KM_NOSLEEP : KM_SLEEP);
Home |
Main Index |
Thread Index |
Old Index