Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs if DEBUG panic => KDASSERT. reduces ifdefs. NFC



details:   https://anonhg.NetBSD.org/src/rev/94888b5dfff2
branches:  trunk
changeset: 822766:94888b5dfff2
user:      maya <maya%NetBSD.org@localhost>
date:      Thu Apr 06 02:55:22 2017 +0000

description:
if DEBUG panic => KDASSERT. reduces ifdefs. NFC

diffstat:

 sys/ufs/lfs/lfs_subr.c |  19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diffs (50 lines):

diff -r f86436add42f -r 94888b5dfff2 sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c    Thu Apr 06 02:38:08 2017 +0000
+++ b/sys/ufs/lfs/lfs_subr.c    Thu Apr 06 02:55:22 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_subr.c,v 1.89 2017/04/06 02:38:08 maya Exp $       */
+/*     $NetBSD: lfs_subr.c,v 1.90 2017/04/06 02:55:22 maya Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.89 2017/04/06 02:38:08 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.90 2017/04/06 02:55:22 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -249,9 +249,6 @@
        int s;
        unsigned int h;
        res_t *re;
-#ifdef DEBUG
-       int i;
-#endif
 
        ASSERT_MAYBE_SEGLOCK(fs);
        h = lfs_mhash(p);
@@ -268,15 +265,15 @@
                        return;
                }
        }
-#ifdef DEBUG
-       for (i = 0; i < LFS_N_TOTAL; i++) {
-               if (fs->lfs_resblk[i].p == p)
-                       panic("lfs_free: inconsistent reserved block");
+
+       for (int i = 0; i < LFS_N_TOTAL; i++) {
+               KDASSERTMSG(fs->lfs_resblk[i].p != p,
+                   "lfs_free: inconsistent reserved block");
        }
-#endif
+
        splx(s);
        mutex_exit(&lfs_lock);
-       
+
        /*
         * If we didn't find it, free it.
         */



Home | Main Index | Thread Index | Old Index