[Midnightbsd-cvs] src [8650] trunk/sys/fs/ext2fs/ext2_inode.c: ext2fs: add some DOINGASYNC checks to match ffs.

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Sun Sep 25 16:00:44 EDT 2016


Revision: 8650
          http://svnweb.midnightbsd.org/src/?rev=8650
Author:   laffer1
Date:     2016-09-25 16:00:44 -0400 (Sun, 25 Sep 2016)
Log Message:
-----------
ext2fs: add some DOINGASYNC checks to match ffs.

Modified Paths:
--------------
    trunk/sys/fs/ext2fs/ext2_inode.c

Modified: trunk/sys/fs/ext2fs/ext2_inode.c
===================================================================
--- trunk/sys/fs/ext2fs/ext2_inode.c	2016-09-25 18:24:03 UTC (rev 8649)
+++ trunk/sys/fs/ext2fs/ext2_inode.c	2016-09-25 20:00:44 UTC (rev 8650)
@@ -180,7 +180,7 @@
 		else
 			bawrite(bp);
 		oip->i_flag |= IN_CHANGE | IN_UPDATE;
-		return (ext2_update(ovp, 1));
+		return (ext2_update(ovp, !DOINGASYNC(ovp)));
 	}
 	/*
 	 * Shorten the size of the file. If the file is not being
@@ -238,7 +238,7 @@
 	for (i = NDADDR - 1; i > lastblock; i--)
 		oip->i_db[i] = 0;
 	oip->i_flag |= IN_CHANGE | IN_UPDATE;
-	allerror = ext2_update(ovp, 1);
+	allerror = ext2_update(ovp, !DOINGASYNC(ovp));
 
 	/*
 	 * Having written the new inode to disk, save its new configuration
@@ -421,9 +421,13 @@
 	  (u_int)(NINDIR(fs) - (last + 1)) * sizeof(int32_t));
 	if (last == -1)
 		bp->b_flags |= B_INVAL;
-	error = bwrite(bp);
-	if (error)
-		allerror = error;
+	if (DOINGASYNC(vp)) {
+		bdwrite(bp);
+	} else {
+		error = bwrite(bp);
+		if (error)
+			allerror = error;
+	}
 	bap = copy;
 
 	/*



More information about the Midnightbsd-cvs mailing list