Source-Changes-HG archive

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

[src/trunk]: src/sys/ufs/lfs Provide a LFS_ENTER_LOG (__nothing) in the !DEBU...



details:   https://anonhg.NetBSD.org/src/rev/f029010280b8
branches:  trunk
changeset: 352514:f029010280b8
user:      maya <maya%NetBSD.org@localhost>
date:      Thu Apr 06 02:38:08 2017 +0000

description:
Provide a LFS_ENTER_LOG (__nothing) in the !DEBUG case.
so I can drop lots of #ifdef DEBUG around this macro. NFCI

diffstat:

 sys/ufs/lfs/lfs_balloc.c  |  11 +++++------
 sys/ufs/lfs/lfs_inode.h   |   3 ++-
 sys/ufs/lfs/lfs_segment.c |   8 ++++----
 sys/ufs/lfs/lfs_subr.c    |  14 ++++++--------
 4 files changed, 17 insertions(+), 19 deletions(-)

diffs (148 lines):

diff -r a3d90b6cdd07 -r f029010280b8 sys/ufs/lfs/lfs_balloc.c
--- a/sys/ufs/lfs/lfs_balloc.c  Thu Apr 06 02:24:51 2017 +0000
+++ b/sys/ufs/lfs/lfs_balloc.c  Thu Apr 06 02:38:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_balloc.c,v 1.91 2016/08/07 02:42:32 dholland Exp $ */
+/*     $NetBSD: lfs_balloc.c,v 1.92 2017/04/06 02:38:08 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_balloc.c,v 1.91 2016/08/07 02:42:32 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_balloc.c,v 1.92 2017/04/06 02:38:08 maya Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -368,13 +368,12 @@
 
                                /* get the block for the next iteration */
                                idaddr = lfs_iblock_get(fs, ibp->b_data, indirs[i].in_off);
-#ifdef DEBUG
+
                                if (vp == fs->lfs_ivnode) {
                                        LFS_ENTER_LOG("balloc", __FILE__,
                                                __LINE__, indirs[i].in_lbn,
                                                ibp->b_flags, curproc->p_pid);
                                }
-#endif
                                /*
                                 * Write out the updated indirect block. Note
                                 * that this writes it out even if we didn't
@@ -450,13 +449,13 @@
                                panic("lfs_balloc: bread bno %lld",
                                    (long long)idp->in_lbn);
                        lfs_iblock_set(fs, ibp->b_data, idp->in_off, UNWRITTEN);
-#ifdef DEBUG
+
                        if (vp == fs->lfs_ivnode) {
                                LFS_ENTER_LOG("balloc", __FILE__,
                                        __LINE__, idp->in_lbn,
                                        ibp->b_flags, curproc->p_pid);
                        }
-#endif
+
                        VOP_BWRITE(ibp->b_vp, ibp);
                }
        } else if (bpp && !(bp->b_oflags & (BO_DONE|BO_DELWRI))) {
diff -r a3d90b6cdd07 -r f029010280b8 sys/ufs/lfs/lfs_inode.h
--- a/sys/ufs/lfs/lfs_inode.h   Thu Apr 06 02:24:51 2017 +0000
+++ b/sys/ufs/lfs/lfs_inode.h   Thu Apr 06 02:38:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_inode.h,v 1.17 2017/04/06 01:54:23 maya Exp $      */
+/*     $NetBSD: lfs_inode.h,v 1.18 2017/04/06 02:38:08 maya Exp $      */
 /*  from NetBSD: ulfs_inode.h,v 1.5 2013/06/06 00:51:50 dholland Exp  */
 /*  from NetBSD: inode.h,v 1.72 2016/06/03 15:36:03 christos Exp  */
 
@@ -273,6 +273,7 @@
 # else /* ! DEBUG */
 #  define LFS_BCLEAN_LOG(fs, bp)
 #  define LFS_BWRITE_LOG(bp)           VOP_BWRITE((bp)->b_vp, (bp))
+#  define LFS_ENTER_LOG(theop, thefile, theline, lbn, theflags, thepid) __nothing
 #  define DLOG(a)
 # endif /* ! DEBUG */
 #else /* ! _KERNEL */
diff -r a3d90b6cdd07 -r f029010280b8 sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Thu Apr 06 02:24:51 2017 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Thu Apr 06 02:38:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.266 2017/04/06 01:54:23 maya Exp $   */
+/*     $NetBSD: lfs_segment.c,v 1.267 2017/04/06 02:38:08 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_segment.c,v 1.266 2017/04/06 01:54:23 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.267 2017/04/06 02:38:08 maya Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {                                         \
@@ -730,9 +730,9 @@
                int loopcount = 0;
 #endif
                do {
-#ifdef DEBUG
+
                        LFS_ENTER_LOG("pretend", __FILE__, __LINE__, 0, 0, curproc->p_pid);
-#endif
+
                        mutex_enter(&lfs_lock);
                        fs->lfs_flags &= ~LFS_IFDIRTY;
                        mutex_exit(&lfs_lock);
diff -r a3d90b6cdd07 -r f029010280b8 sys/ufs/lfs/lfs_subr.c
--- a/sys/ufs/lfs/lfs_subr.c    Thu Apr 06 02:24:51 2017 +0000
+++ b/sys/ufs/lfs/lfs_subr.c    Thu Apr 06 02:38:08 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_subr.c,v 1.88 2017/04/01 14:53:48 maya Exp $       */
+/*     $NetBSD: lfs_subr.c,v 1.89 2017/04/06 02:38:08 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.88 2017/04/01 14:53:48 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_subr.c,v 1.89 2017/04/06 02:38:08 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -317,9 +317,8 @@
        mutex_exit(&lfs_lock);
        fs->lfs_cleanind = 0;
 
-#ifdef DEBUG
        LFS_ENTER_LOG("seglock", __FILE__, __LINE__, 0, flags, curproc->p_pid);
-#endif
+
        /* Drain fragment size changes out */
        rw_enter(&fs->lfs_fraglock, RW_WRITER);
 
@@ -487,9 +486,8 @@
                 * to complete.
                 */
                if (!ckp) {
-#ifdef DEBUG
                        LFS_ENTER_LOG("segunlock_std", __FILE__, __LINE__, 0, 0, curproc->p_pid);
-#endif
+
                        mutex_enter(&lfs_lock);
                        --fs->lfs_seglock;
                        fs->lfs_lockpid = 0;
@@ -533,9 +531,9 @@
                                        lfs_auto_segclean(fs);
                        }
                        fs->lfs_activesb = 1 - fs->lfs_activesb;
-#ifdef DEBUG
+
                        LFS_ENTER_LOG("segunlock_ckp", __FILE__, __LINE__, 0, 0, curproc->p_pid);
-#endif
+
                        mutex_enter(&lfs_lock);
                        --fs->lfs_seglock;
                        fs->lfs_lockpid = 0;



Home | Main Index | Thread Index | Old Index