Module Name:    src
Committed By:   maya
Date:           Thu Apr  6 02:38:08 UTC 2017

Modified Files:
        src/sys/ufs/lfs: lfs_balloc.c lfs_inode.h lfs_segment.c lfs_subr.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.91 -r1.92 src/sys/ufs/lfs/lfs_balloc.c
cvs rdiff -u -r1.17 -r1.18 src/sys/ufs/lfs/lfs_inode.h
cvs rdiff -u -r1.266 -r1.267 src/sys/ufs/lfs/lfs_segment.c
cvs rdiff -u -r1.88 -r1.89 src/sys/ufs/lfs/lfs_subr.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/lfs/lfs_balloc.c
diff -u src/sys/ufs/lfs/lfs_balloc.c:1.91 src/sys/ufs/lfs/lfs_balloc.c:1.92
--- src/sys/ufs/lfs/lfs_balloc.c:1.91	Sun Aug  7 02:42:32 2016
+++ src/sys/ufs/lfs/lfs_balloc.c	Thu Apr  6 02:38:08 2017
@@ -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 @@ lfs_balloc(struct vnode *vp, off_t start
 
 				/* 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 @@ lfs_balloc(struct vnode *vp, off_t start
 				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))) {

Index: src/sys/ufs/lfs/lfs_inode.h
diff -u src/sys/ufs/lfs/lfs_inode.h:1.17 src/sys/ufs/lfs/lfs_inode.h:1.18
--- src/sys/ufs/lfs/lfs_inode.h:1.17	Thu Apr  6 01:54:23 2017
+++ src/sys/ufs/lfs/lfs_inode.h	Thu Apr  6 02:38:08 2017
@@ -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 @@ extern struct lfs_log_entry lfs_log[LFS_
 # 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 */

Index: src/sys/ufs/lfs/lfs_segment.c
diff -u src/sys/ufs/lfs/lfs_segment.c:1.266 src/sys/ufs/lfs/lfs_segment.c:1.267
--- src/sys/ufs/lfs/lfs_segment.c:1.266	Thu Apr  6 01:54:23 2017
+++ src/sys/ufs/lfs/lfs_segment.c	Thu Apr  6 02:38:08 2017
@@ -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 @@ lfs_segwrite(struct mount *mp, int flags
 		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);

Index: src/sys/ufs/lfs/lfs_subr.c
diff -u src/sys/ufs/lfs/lfs_subr.c:1.88 src/sys/ufs/lfs/lfs_subr.c:1.89
--- src/sys/ufs/lfs/lfs_subr.c:1.88	Sat Apr  1 14:53:48 2017
+++ src/sys/ufs/lfs/lfs_subr.c	Thu Apr  6 02:38:08 2017
@@ -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 @@ lfs_seglock(struct lfs *fs, unsigned lon
 	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 @@ lfs_segunlock(struct lfs *fs)
 		 * 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_segunlock(struct lfs *fs)
 					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;

Reply via email to