prtactive

Kostik Belousov kostikbel at gmail.com
Thu Nov 18 22:13:53 UTC 2010


Did anybody on the list used or consider it useful the printf()s
in miscellaneous VOP_INACTIVE and VOP_RECLAIM implementations ?
I plan to axe prtactive and corresponding printfs that seems to
be never activated on my memory. The situation where the
message would be emited is completely legitimate (forced unmount).

I will commit the following patch, unless valid reason to not is given.

diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index 64d449e..e1c68c6 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -69,9 +69,6 @@ cd9660_inactive(ap)
 	struct iso_node *ip = VTOI(vp);
 	int error = 0;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("cd9660_inactive: pushing active", vp);
-
 	/*
 	 * If we are done with the inode, reclaim it
 	 * so that it can be reused immediately.
@@ -93,8 +90,6 @@ cd9660_reclaim(ap)
 {
 	struct vnode *vp = ap->a_vp;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("cd9660_reclaim: pushing active", vp);
 	/*
 	 * Destroy the vm object and flush associated pages.
 	 */
diff --git a/sys/fs/coda/coda_vnops.c b/sys/fs/coda/coda_vnops.c
index 02f6eb5..51fb307 100644
--- a/sys/fs/coda/coda_vnops.c
+++ b/sys/fs/coda/coda_vnops.c
@@ -1549,9 +1549,6 @@ coda_reclaim(struct vop_reclaim_args *ap)
 				    "%p, cp %p\n", vp, cp);
 		}
 #endif
-	} else {
-		if (prtactive && vp->v_usecount != 0)
-			vprint("coda_reclaim: pushing active", vp);
 	}
 	cache_purge(vp);
 	coda_free(VTOC(vp));
diff --git a/sys/fs/ext2fs/ext2_inode.c b/sys/fs/ext2fs/ext2_inode.c
index 2cf60a7..fc65a63 100644
--- a/sys/fs/ext2fs/ext2_inode.c
+++ b/sys/fs/ext2fs/ext2_inode.c
@@ -481,9 +481,6 @@ ext2_inactive(ap)
 	struct thread *td = ap->a_td;
 	int mode, error = 0;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ext2_inactive: pushing active", vp);
-
 	/*
 	 * Ignore inodes related to stale file handles.
 	 */
@@ -522,8 +519,6 @@ ext2_reclaim(ap)
 	struct inode *ip;
 	struct vnode *vp = ap->a_vp;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ufs_reclaim: pushing active", vp);
 	ip = VTOI(vp);
 	if (ip->i_flag & IN_LAZYMOD) {
 		ip->i_flag |= IN_MODIFIED;
diff --git a/sys/fs/hpfs/hpfs_vnops.c b/sys/fs/hpfs/hpfs_vnops.c
index 4ec6b1e..3859478 100644
--- a/sys/fs/hpfs/hpfs_vnops.c
+++ b/sys/fs/hpfs/hpfs_vnops.c
@@ -575,9 +575,6 @@ hpfs_inactive(ap)
 			return (error);
 	}
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("hpfs_inactive: pushing active", vp);
-
 	if (hp->h_flag & H_INVAL) {
 		vrecycle(vp, ap->a_td);
 		return (0);
diff --git a/sys/fs/msdosfs/msdosfs_denode.c b/sys/fs/msdosfs/msdosfs_denode.c
index 9ad892e..84b52ba 100644
--- a/sys/fs/msdosfs/msdosfs_denode.c
+++ b/sys/fs/msdosfs/msdosfs_denode.c
@@ -548,8 +548,6 @@ msdosfs_reclaim(ap)
 	    dep, dep->de_Name, dep->de_refcnt);
 #endif
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("msdosfs_reclaim(): pushing active", vp);
 	/*
 	 * Destroy the vm object and flush associated pages.
 	 */
@@ -586,9 +584,6 @@ msdosfs_inactive(ap)
 	printf("msdosfs_inactive(): dep %p, de_Name[0] %x\n", dep, dep->de_Name[0]);
 #endif
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("msdosfs_inactive(): pushing active", vp);
-
 	/*
 	 * Ignore denodes related to stale file handles.
 	 */
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c
index 430b494..01e1919 100644
--- a/sys/fs/nfsclient/nfs_clnode.c
+++ b/sys/fs/nfsclient/nfs_clnode.c
@@ -190,8 +190,6 @@ ncl_inactive(struct vop_inactive_args *ap)
 	struct vnode *vp = ap->a_vp;
 
 	np = VTONFS(vp);
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ncl_inactive: pushing active", vp);
 
 	if (NFS_ISV4(vp) && vp->v_type == VREG) {
 		/*
@@ -233,9 +231,6 @@ ncl_reclaim(struct vop_reclaim_args *ap)
 	struct nfsnode *np = VTONFS(vp);
 	struct nfsdmap *dp, *dp2;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ncl_reclaim: pushing active", vp);
-
 	if (NFS_ISV4(vp) && vp->v_type == VREG)
 		/*
 		 * Since mmap()'d files do I/O after VOP_CLOSE(), the NFSv4
diff --git a/sys/fs/ntfs/ntfs_vnops.c b/sys/fs/ntfs/ntfs_vnops.c
index ee62a5c..6970474 100644
--- a/sys/fs/ntfs/ntfs_vnops.c
+++ b/sys/fs/ntfs/ntfs_vnops.c
@@ -82,8 +82,6 @@ static vop_fsync_t	ntfs_fsync;
 static vop_pathconf_t	ntfs_pathconf;
 static vop_vptofh_t	ntfs_vptofh;
 
-int	ntfs_prtactive = 1;	/* 1 => print out reclaim of active vnodes */
-
 /*
  * This is a noop, simply returning what one has been given.
  */
@@ -214,15 +212,12 @@ ntfs_inactive(ap)
 		struct vnode *a_vp;
 	} */ *ap;
 {
-	register struct vnode *vp = ap->a_vp;
 #ifdef NTFS_DEBUG
-	register struct ntnode *ip = VTONT(vp);
+	register struct ntnode *ip = VTONT(ap->a_vp);
 #endif
 
-	dprintf(("ntfs_inactive: vnode: %p, ntnode: %d\n", vp, ip->i_number));
-
-	if (ntfs_prtactive && vrefcnt(vp) != 0)
-		vprint("ntfs_inactive: pushing active", vp);
+	dprintf(("ntfs_inactive: vnode: %p, ntnode: %d\n", ap->a_vp,
+	    ip->i_number));
 
 	/* XXX since we don't support any filesystem changes
 	 * right now, nothing more needs to be done
@@ -246,9 +241,6 @@ ntfs_reclaim(ap)
 
 	dprintf(("ntfs_reclaim: vnode: %p, ntnode: %d\n", vp, ip->i_number));
 
-	if (ntfs_prtactive && vrefcnt(vp) != 0)
-		vprint("ntfs_reclaim: pushing active", vp);
-
 	/*
 	 * Destroy the vm object and flush associated pages.
 	 */
diff --git a/sys/gnu/fs/reiserfs/reiserfs_inode.c b/sys/gnu/fs/reiserfs/reiserfs_inode.c
index 46edbf4..b63ed74 100644
--- a/sys/gnu/fs/reiserfs/reiserfs_inode.c
+++ b/sys/gnu/fs/reiserfs/reiserfs_inode.c
@@ -114,8 +114,6 @@ reiserfs_inactive(struct vop_inactive_args *ap)
 
 	reiserfs_log(LOG_DEBUG, "deactivating inode used %d times\n",
 	    vp->v_usecount);
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ReiserFS/reclaim: pushing active", vp);
 
 #if 0
 	/* Ignore inodes related to stale file handles. */
@@ -147,8 +145,6 @@ reiserfs_reclaim(struct vop_reclaim_args *ap)
 
 	reiserfs_log(LOG_DEBUG, "reclaiming inode used %d times\n",
 	    vp->v_usecount);
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("ReiserFS/reclaim: pushing active", vp);
 	ip = VTOI(vp);
 
 	/* XXX Update this node (write to the disk) */
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 4a4cef1..b032513 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -191,9 +191,6 @@ struct nfs_public nfs_pub;
 static uma_zone_t vnode_zone;
 static uma_zone_t vnodepoll_zone;
 
-/* Set to 1 to print out reclaim of active vnodes */
-int	prtactive;
-
 /*
  * The workitem queue.
  *
diff --git a/sys/nfsclient/nfs_node.c b/sys/nfsclient/nfs_node.c
index 5b87bd7..5b43b3d 100644
--- a/sys/nfsclient/nfs_node.c
+++ b/sys/nfsclient/nfs_node.c
@@ -193,8 +193,6 @@ nfs_inactive(struct vop_inactive_args *ap)
 	struct thread *td = curthread;	/* XXX */
 
 	np = VTONFS(ap->a_vp);
-	if (prtactive && vrefcnt(ap->a_vp) != 0)
-		vprint("nfs_inactive: pushing active", ap->a_vp);
 	mtx_lock(&np->n_mtx);
 	if (ap->a_vp->v_type != VDIR) {
 		sp = np->n_sillyrename;
@@ -228,9 +226,6 @@ nfs_reclaim(struct vop_reclaim_args *ap)
 	struct nfsnode *np = VTONFS(vp);
 	struct nfsdmap *dp, *dp2;
 
-	if (prtactive && vrefcnt(vp) != 0)
-		vprint("nfs_reclaim: pushing active", vp);
-
 	/*
 	 * If the NLM is running, give it a chance to abort pending
 	 * locks.
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index e82f8ea..86ff8b6 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -410,7 +410,6 @@ extern	struct vnode *rootvnode;	/* root (i.e. "/") vnode */
 extern	int async_io_version;		/* 0 or POSIX version of AIO i'face */
 extern	int desiredvnodes;		/* number of vnodes desired */
 extern	struct uma_zone *namei_zone;
-extern	int prtactive;			/* nonzero to call vprint() */
 extern	struct vattr va_null;		/* predefined null vattr structure */
 
 #define	VI_LOCK(vp)	mtx_lock(&(vp)->v_interlock)
diff --git a/sys/ufs/ufs/ufs_inode.c b/sys/ufs/ufs/ufs_inode.c
index a281ae5..e21092c 100644
--- a/sys/ufs/ufs/ufs_inode.c
+++ b/sys/ufs/ufs/ufs_inode.c
@@ -80,8 +80,6 @@ ufs_inactive(ap)
 	struct mount *mp;
 
 	mp = NULL;
-	if (prtactive && vp->v_usecount != 0)
-		vprint("ufs_inactive: pushing active", vp);
 	/*
 	 * Ignore inodes related to stale file handles.
 	 */
@@ -191,8 +189,6 @@ ufs_reclaim(ap)
 	int i;
 #endif
 
-	if (prtactive && vp->v_usecount != 0)
-		vprint("ufs_reclaim: pushing active", vp);
 	/*
 	 * Destroy the vm object and flush associated pages.
 	 */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20101118/923ba974/attachment.pgp


More information about the freebsd-fs mailing list