Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs add debug code to lfs_free.



details:   https://anonhg.NetBSD.org/src/rev/4ec47a085bd1
branches:  trunk
changeset: 543216:4ec47a085bd1
user:      yamt <yamt%NetBSD.org@localhost>
date:      Wed Feb 19 12:58:53 2003 +0000

description:
add debug code to lfs_free.

diffstat:

 sys/ufs/lfs/lfs_subr.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (47 lines):

diff -r f75ce4d84576 -r 4ec47a085bd1 sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c    Wed Feb 19 12:55:58 2003 +0000
+++ b/sys/ufs/lfs/lfs_subr.c    Wed Feb 19 12:58:53 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_subr.c,v 1.31 2003/02/17 23:48:20 perseant Exp $   */
+/*     $NetBSD: lfs_subr.c,v 1.32 2003/02/19 12:58:53 yamt Exp $       */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.31 2003/02/17 23:48:20 perseant Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.32 2003/02/19 12:58:53 yamt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -270,11 +270,15 @@
        int s;
        unsigned int h;
        res_t *re;
+#ifdef DEBUG
+       int i;
+#endif
 
        h = lfs_mhash(p);
        s = splbio();
        LIST_FOREACH(re, &fs->lfs_reshash[h], res) {
                if (re->p == p) {
+                       KASSERT(re->inuse == 1);
                        LIST_REMOVE(re, res);
                        re->inuse = 0;
                        wakeup(&fs->lfs_resblk);
@@ -282,6 +286,12 @@
                        return;
                }
        }
+#ifdef DEBUG
+       for (i = 0; i < LFS_N_TOTAL; i++) {
+               if (fs->lfs_resblk[i].p == p)
+                       panic("lfs_free: inconsist reserved block");
+       }
+#endif
        splx(s);
 
        /*



Home | Main Index | Thread Index | Old Index