[Midnightbsd-cvs] src [8607] trunk/sys: add yet another flag for the vfs_write_resume_flags to avoid calling suspension cleanup handle after the suspend is lifted

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 13:31:43 EDT 2016


Revision: 8607
          http://svnweb.midnightbsd.org/src/?rev=8607
Author:   laffer1
Date:     2016-09-25 13:31:43 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
add yet another flag for the vfs_write_resume_flags to avoid calling suspension cleanup handle after the suspend is lifted

Modified Paths:
--------------
    trunk/sys/kern/vfs_vnops.c
    trunk/sys/sys/vnode.h
    trunk/sys/ufs/ffs/ffs_snapshot.c

Modified: trunk/sys/kern/vfs_vnops.c
===================================================================
--- trunk/sys/kern/vfs_vnops.c	2016-09-25 17:29:58 UTC (rev 8606)
+++ trunk/sys/kern/vfs_vnops.c	2016-09-25 17:31:43 UTC (rev 8607)
@@ -1641,7 +1641,8 @@
 			mp->mnt_writeopcount++;
 		}
 		MNT_IUNLOCK(mp);
-		VFS_SUSP_CLEAN(mp);
+		if ((flags & VR_NO_SUSPCLR) == 0)
+			VFS_SUSP_CLEAN(mp);
 	} else if ((flags & VR_START_WRITE) != 0) {
 		MNT_REF(mp);
 		vn_start_write_locked(mp, 0);

Modified: trunk/sys/sys/vnode.h
===================================================================
--- trunk/sys/sys/vnode.h	2016-09-25 17:29:58 UTC (rev 8606)
+++ trunk/sys/sys/vnode.h	2016-09-25 17:31:43 UTC (rev 8607)
@@ -394,6 +394,7 @@
 #define	V_XSLEEP	0x0004	/* vn_start_write: just return after sleep */
 
 #define	VR_START_WRITE	0x0001	/* vfs_write_resume: start write atomically */
+#define	VR_NO_SUSPCLR	0x0002	/* vfs_write_resume: do not clear suspension */
 
 #define	VREF(vp)	vref(vp)
 

Modified: trunk/sys/ufs/ffs/ffs_snapshot.c
===================================================================
--- trunk/sys/ufs/ffs/ffs_snapshot.c	2016-09-25 17:29:58 UTC (rev 8606)
+++ trunk/sys/ufs/ffs/ffs_snapshot.c	2016-09-25 17:31:43 UTC (rev 8607)
@@ -686,7 +686,7 @@
 	/*
 	 * Resume operation on filesystem.
 	 */
-	vfs_write_resume_flags(vp->v_mount, VR_START_WRITE);
+	vfs_write_resume_flags(vp->v_mount, VR_START_WRITE | VR_NO_SUSPCLR);
 	if (collectsnapstats && starttime.tv_sec > 0) {
 		nanotime(&endtime);
 		timespecsub(&endtime, &starttime);



More information about the Midnightbsd-cvs mailing list