xfs: log file size updates as part of unwritten extent conversion

If we convert and unwritten extent past the current i_size log the size update
as part of the extent manipulation transactions instead of doing an unlogged
metadata update later.

Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mark Tinguely <tinguely@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>

diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 745492b..8e11b07 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -179,13 +179,14 @@
 			ioend->io_error = -error;
 			goto done;
 		}
+	} else {
+		/*
+		 * We might have to update the on-disk file size after
+		 * extending writes.
+		 */
+		xfs_setfilesize(ioend);
 	}
 
-	/*
-	 * We might have to update the on-disk file size after extending
-	 * writes.
-	 */
-	xfs_setfilesize(ioend);
 done:
 	xfs_destroy_ioend(ioend);
 }