PERFORCE change 167542 for review

Aditya Sarawgi truncs at FreeBSD.org
Thu Aug 20 16:06:46 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=167542

Change 167542 by truncs at aditya on 2009/08/20 16:05:51

	Change IO_SYNC to B_SYNC.

Affected files ...

.. //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#5 edit

Differences ...

==== //depot/projects/soc2009/soc_ext2fs/src/sys/gnu/fs/ext2fs/ext2_inode.c#5 (text+ko) ====

@@ -152,7 +152,6 @@
 	}
 	fs = oip->i_e2fs;
 	osize = oip->i_size;
-	ext2_discard_prealloc(oip);
 	/*
 	 * Lengthen the size of the file. We must ensure that the
 	 * last byte of the file is allocated. Since the smallest
@@ -164,13 +163,13 @@
 		offset = blkoff(fs, length - 1);
 		lbn = lblkno(fs, length - 1);
 		aflags = B_CLRBUF;
-		if (flags & IO_SYNC)
+		if (flags & B_SYNC)
 			aflags |= B_SYNC;
-		vnode_pager_setsize(ovp, length);
 		if ((error = ext2_balloc(oip, lbn, offset + 1, cred, &bp,
 		    aflags)) != 0)
 			return (error);
 		oip->i_size = length;
+		vnode_pager_setsize(ovp, length);
 		if (aflags & IO_SYNC)
 			bwrite(bp);
 		else
@@ -201,11 +200,12 @@
 		size = blksize(fs, oip, lbn);
 		bzero((char *)bp->b_data + offset, (u_int)(size - offset));
 		allocbuf(bp, size);
-		if (aflags & IO_SYNC)
+		if (aflags & B_SYNC)
 			bwrite(bp);
 		else
 			bawrite(bp);
 	}
+	vnode_pager_setsize(ovp, length);
 	/*
 	 * Calculate index into inode's block list of
 	 * last direct and indirect blocks (if any)
@@ -470,7 +470,6 @@
 	struct thread *td = ap->a_td;
 	int mode, error = 0;
 
-	ext2_discard_prealloc(ip);
 	if (prtactive && vrefcnt(vp) != 0)
 		vprint("ext2_inactive: pushing active", vp);
 


More information about the p4-projects mailing list