svn commit: r245762 - stable/9/sys/fs/ext2fs

Pedro F. Giffuni pfg at FreeBSD.org
Tue Jan 22 03:32:14 UTC 2013


Author: pfg
Date: Tue Jan 22 03:32:13 2013
New Revision: 245762
URL: http://svnweb.freebsd.org/changeset/base/245762

Log:
  MFC	r245612:
  
  ext2fs: Add some DOINGASYNC checks to match ffs.
  This is mostly cosmetical.
  
  Reviewed by:    bde

Modified:
  stable/9/sys/fs/ext2fs/ext2_inode.c

Modified: stable/9/sys/fs/ext2fs/ext2_inode.c
==============================================================================
--- stable/9/sys/fs/ext2fs/ext2_inode.c	Tue Jan 22 03:23:14 2013	(r245761)
+++ stable/9/sys/fs/ext2fs/ext2_inode.c	Tue Jan 22 03:32:13 2013	(r245762)
@@ -180,7 +180,7 @@ ext2_truncate(vp, length, flags, cred, t
 		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 @@ ext2_truncate(vp, length, flags, cred, t
 	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 @@ ext2_indirtrunc(ip, lbn, dbn, lastbn, le
 	  (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 svn-src-all mailing list