Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2012 23:01:12 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r234158 - in head/sys: kern sys ufs/ffs
Message-ID:  <201204112301.q3BN1Ctn099598@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Wed Apr 11 23:01:11 2012
New Revision: 234158
URL: http://svn.freebsd.org/changeset/base/234158

Log:
  Export vinactive() from kern/vfs_subr.c (e.g., make it no longer
  static and declare its prototype in sys/vnode.h) so that it can be
  called from process_deferred_inactive() (in ufs/ffs/ffs_snapshot.c)
  instead of the body of vinactive() being cut and pasted into
  process_deferred_inactive().
  
  Reviewed by: kib
  MFC after:   2 weeks

Modified:
  head/sys/kern/vfs_subr.c
  head/sys/sys/vnode.h
  head/sys/ufs/ffs/ffs_snapshot.c

Modified: head/sys/kern/vfs_subr.c
==============================================================================
--- head/sys/kern/vfs_subr.c	Wed Apr 11 22:43:40 2012	(r234157)
+++ head/sys/kern/vfs_subr.c	Wed Apr 11 23:01:11 2012	(r234158)
@@ -103,7 +103,6 @@ static int	flushbuflist(struct bufv *buf
 static void	syncer_shutdown(void *arg, int howto);
 static int	vtryrecycle(struct vnode *vp);
 static void	vbusy(struct vnode *vp);
-static void	vinactive(struct vnode *, struct thread *);
 static void	v_incr_usecount(struct vnode *);
 static void	v_decr_usecount(struct vnode *);
 static void	v_decr_useonly(struct vnode *);
@@ -2401,7 +2400,7 @@ vdropl(struct vnode *vp)
  * OWEINACT tracks whether a vnode missed a call to inactive due to a
  * failed lock upgrade.
  */
-static void
+void
 vinactive(struct vnode *vp, struct thread *td)
 {
 

Modified: head/sys/sys/vnode.h
==============================================================================
--- head/sys/sys/vnode.h	Wed Apr 11 22:43:40 2012	(r234157)
+++ head/sys/sys/vnode.h	Wed Apr 11 23:01:11 2012	(r234158)
@@ -632,6 +632,7 @@ int	vget(struct vnode *vp, int lockflag,
 void	vgone(struct vnode *vp);
 void	vhold(struct vnode *);
 void	vholdl(struct vnode *);
+void	vinactive(struct vnode *, struct thread *);
 int	vinvalbuf(struct vnode *vp, int save, int slpflag, int slptimeo);
 int	vtruncbuf(struct vnode *vp, struct ucred *cred, struct thread *td,
 	    off_t length, int blksize);

Modified: head/sys/ufs/ffs/ffs_snapshot.c
==============================================================================
--- head/sys/ufs/ffs/ffs_snapshot.c	Wed Apr 11 22:43:40 2012	(r234157)
+++ head/sys/ufs/ffs/ffs_snapshot.c	Wed Apr 11 23:01:11 2012	(r234158)
@@ -2572,20 +2572,9 @@ process_deferred_inactive(struct mount *
 			MNT_ILOCK(mp);
 			continue;
 		}
-		
-		VNASSERT((vp->v_iflag & VI_DOINGINACT) == 0, vp,
-			 ("process_deferred_inactive: "
-			  "recursed on VI_DOINGINACT"));
-		vp->v_iflag |= VI_DOINGINACT;
-		vp->v_iflag &= ~VI_OWEINACT;
-		VI_UNLOCK(vp);
-		(void) VOP_INACTIVE(vp, td);
-		VI_LOCK(vp);
-		VNASSERT(vp->v_iflag & VI_DOINGINACT, vp,
-			 ("process_deferred_inactive: lost VI_DOINGINACT"));
+		vinactive(vp, td);
 		VNASSERT((vp->v_iflag & VI_OWEINACT) == 0, vp,
 			 ("process_deferred_inactive: got VI_OWEINACT"));
-		vp->v_iflag &= ~VI_DOINGINACT;
 		VI_UNLOCK(vp);
 		VOP_UNLOCK(vp, 0);
 		vdrop(vp);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204112301.q3BN1Ctn099598>