Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs remove noncompilable WAPBL_DEBUG_INODES



details:   https://anonhg.NetBSD.org/src/rev/2530f5e16b30
branches:  trunk
changeset: 1009067:2530f5e16b30
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sat Apr 11 17:43:54 2020 +0000

description:
remove noncompilable WAPBL_DEBUG_INODES

PR kern/49554 by Thomas Klausner

diffstat:

 sys/ufs/ffs/ffs_wapbl.c |    8 +-
 sys/ufs/files.ufs       |    3 +-
 sys/ufs/ufs/ufs_wapbl.c |  164 ------------------------------------------------
 sys/ufs/ufs/ufs_wapbl.h |   22 +------
 4 files changed, 4 insertions(+), 193 deletions(-)

diffs (261 lines):

diff -r ed573c5e85e4 -r 2530f5e16b30 sys/ufs/ffs/ffs_wapbl.c
--- a/sys/ufs/ffs/ffs_wapbl.c   Sat Apr 11 17:21:16 2020 +0000
+++ b/sys/ufs/ffs/ffs_wapbl.c   Sat Apr 11 17:43:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ffs_wapbl.c,v 1.45 2020/01/17 20:08:10 ad Exp $        */
+/*     $NetBSD: ffs_wapbl.c,v 1.46 2020/04/11 17:43:54 jdolecek Exp $  */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.45 2020/01/17 20:08:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_wapbl.c,v 1.46 2020/04/11 17:43:54 jdolecek Exp $");
 
 #define WAPBL_INTERNAL
 
@@ -179,10 +179,6 @@
 
        UFS_WAPBL_JLOCK_ASSERT(ump->um_mountp);
 
-#ifdef WAPBL_DEBUG_INODES
-       ufs_wapbl_verify_inodes(mp, __func__);
-#endif
-
        for (wd = fdealloc; wd != NULL; wd = TAILQ_NEXT(wd, wd_entries)) {
                /*
                 * blkfree errors are unreported, might silently fail
diff -r ed573c5e85e4 -r 2530f5e16b30 sys/ufs/files.ufs
--- a/sys/ufs/files.ufs Sat Apr 11 17:21:16 2020 +0000
+++ b/sys/ufs/files.ufs Sat Apr 11 17:43:54 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.ufs,v 1.45 2019/06/17 03:32:58 christos Exp $
+#      $NetBSD: files.ufs,v 1.46 2020/04/11 17:43:54 jdolecek Exp $
 
 deffs                                  FFS
 deffs                                  EXT2FS
@@ -111,4 +111,3 @@
 file   ufs/ufs/ufs_rename.c            ffs | mfs | chfs
 file   ufs/ufs/ufs_vfsops.c            ufs & (ffs | mfs | ext2fs | chfs)
 file   ufs/ufs/ufs_vnops.c             ufs & (ffs | mfs | ext2fs | chfs)
-file   ufs/ufs/ufs_wapbl.c             ffs & wapbl
diff -r ed573c5e85e4 -r 2530f5e16b30 sys/ufs/ufs/ufs_wapbl.c
--- a/sys/ufs/ufs/ufs_wapbl.c   Sat Apr 11 17:21:16 2020 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,164 +0,0 @@
-/*  $NetBSD: ufs_wapbl.c,v 1.25 2019/12/22 19:47:35 ad Exp $ */
-
-/*-
- * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Wasabi Systems, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (c) 1982, 1986, 1989, 1993, 1995
- *     The Regents of the University of California.  All rights reserved.
- * (c) UNIX System Laboratories, Inc.
- * All or some portions of this file are derived from material licensed
- * to the University of California by American Telephone and Telegraph
- * Co. or Unix System Laboratories, Inc. and are reproduced herein with
- * the permission of UNIX System Laboratories, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- *     @(#)ufs_vnops.c 8.28 (Berkeley) 7/31/95
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ufs_wapbl.c,v 1.25 2019/12/22 19:47:35 ad Exp $");
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/namei.h>
-#include <sys/resourcevar.h>
-#include <sys/kernel.h>
-#include <sys/file.h>
-#include <sys/stat.h>
-#include <sys/buf.h>
-#include <sys/proc.h>
-#include <sys/mount.h>
-#include <sys/vnode.h>
-#include <sys/dirent.h>
-#include <sys/lockf.h>
-#include <sys/kauth.h>
-#include <sys/wapbl.h>
-
-#include <miscfs/specfs/specdev.h>
-#include <miscfs/fifofs/fifo.h>
-
-#include <ufs/ufs/quota.h>
-#include <ufs/ufs/inode.h>
-#include <ufs/ufs/dir.h>
-#include <ufs/ufs/ufsmount.h>
-#include <ufs/ufs/ufs_bswap.h>
-#include <ufs/ufs/ufs_extern.h>
-#include <ufs/ufs/ufs_wapbl.h>
-#include <ufs/ext2fs/ext2fs_extern.h>
-#include <ufs/lfs/lfs_extern.h>
-
-#include <uvm/uvm.h>
-
-#ifdef WAPBL_DEBUG_INODES
-#error WAPBL_DEBUG_INODES: not functional before ufs_wapbl.c is updated
-void
-ufs_wapbl_verify_inodes(struct mount *mp, const char *str)
-{
-       struct vnode *vp, *nvp;
-       struct inode *ip;
-       struct buf *bp, *nbp;
-
-       mutex_enter(mp->mnt_vnodelock);
- loop:
-       TAILQ_FOREACH_REVERSE(vp, &mp->mnt_vnodelist, vnodelst, v_mntvnodes) {
-               /*
-                * If the vnode that we are about to sync is no longer
-                * associated with this mount point, start over.
-                */
-               if (vp->v_mount != mp)
-                       goto loop;
-               mutex_enter(vp->v_interlock);
-               nvp = TAILQ_NEXT(vp, v_mntvnodes);
-               ip = VTOI(vp);
-               if (vp->v_type == VNON) {
-                       mutex_exit(vp->v_interlock);
-                       continue;
-               }
-               /* verify that update has been called on all inodes */
-               if (ip->i_flag & (IN_CHANGE | IN_UPDATE)) {
-                       panic("wapbl_verify: mp %p: dirty vnode %p (inode %p): 0x%x\n",
-                               mp, vp, ip, ip->i_flag);
-               }
-               mutex_exit(mp->mnt_vnodelock);
-
-               mutex_enter(&bufcache_lock);
-               for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
-                       nbp = LIST_NEXT(bp, b_vnbufs);
-                       if ((bp->b_cflags & BC_BUSY)) {
-                               continue;
-                       }
-                       KASSERT((bp->b_oflags & BO_DELWRI) != 0);
-                       KASSERT((bp->b_flags & B_LOCKED) != 0);
-               }
-               mutex_exit(&bufcache_lock);
-               mutex_exit(vp->v_interlock);
-
-               mutex_enter(mp->mnt_vnodelock);
-       }
-       mutex_exit(mp->mnt_vnodelock);
-
-       vp = VFSTOUFS(mp)->um_devvp;
-       mutex_enter(vp->v_interlock);
-       mutex_enter(&bufcache_lock);
-       for (bp = LIST_FIRST(&vp->v_dirtyblkhd); bp; bp = nbp) {
-               nbp = LIST_NEXT(bp, b_vnbufs);
-               if ((bp->b_cflags & BC_BUSY)) {
-                       continue;
-               }
-               KASSERT((bp->b_oflags & BO_DELWRI) != 0);
-               KASSERT((bp->b_flags & B_LOCKED) != 0);
-       }
-       mutex_exit(&bufcache_lock);
-       mutex_exit(vp->v_interlock);
-}
-#endif /* WAPBL_DEBUG_INODES */
diff -r ed573c5e85e4 -r 2530f5e16b30 sys/ufs/ufs/ufs_wapbl.h
--- a/sys/ufs/ufs/ufs_wapbl.h   Sat Apr 11 17:21:16 2020 +0000
+++ b/sys/ufs/ufs/ufs_wapbl.h   Sat Apr 11 17:43:54 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ufs_wapbl.h,v 1.18 2020/03/05 15:18:55 riastradh Exp $ */
+/*     $NetBSD: ufs_wapbl.h,v 1.19 2020/04/11 17:43:54 jdolecek Exp $  */
 
 /*-
  * Copyright (c) 2003,2006,2008 The NetBSD Foundation, Inc.
@@ -82,18 +82,6 @@
 
 #if defined(WAPBL)
 
-#if defined(WAPBL_DEBUG)
-#define        WAPBL_DEBUG_INODES
-#endif
-
-#ifdef WAPBL_DEBUG_INODES
-#error Undefine WAPBL_DEBUG_INODES or update the code.  Have a nice day.
-#endif
-
-#ifdef WAPBL_DEBUG_INODES
-void   ufs_wapbl_verify_inodes(struct mount *, const char *);
-#endif
-
 static __inline int
 ufs_wapbl_begin(struct mount *mp, const char *file, int line)
 {
@@ -102,10 +90,6 @@
                error = wapbl_begin(mp->mnt_wapbl, file, line);
                if (error)
                        return error;
-#ifdef WAPBL_DEBUG_INODES
-               if (mp->mnt_wapbl->wl_lock.lk_exclusivecount == 1)
-                       ufs_wapbl_verify_inodes(mp, "wapbl_begin");
-#endif
        }
        return 0;
 }
@@ -114,10 +98,6 @@
 ufs_wapbl_end(struct mount *mp)
 {
        if (mp->mnt_wapbl) {
-#ifdef WAPBL_DEBUG_INODES
-               if (mp->mnt_wapbl->wl_lock.lk_exclusivecount == 1)
-                       ufs_wapbl_verify_inodes(mp, "wapbl_end");
-#endif
                wapbl_end(mp->mnt_wapbl);
        }
 }



Home | Main Index | Thread Index | Old Index