Revert "f2fs: resync with upstream 3.4 branch (forced update)"

This reverts commit 6a1be380100e402aacca6a0a3ac829c059768d79.
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 938591a..0e88a75 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -124,30 +124,12 @@
 		return 0;
 
 	trace_f2fs_sync_file_enter(inode);
-
-	/* if fdatasync is triggered, let's do in-place-update */
-	if (datasync)
-		set_inode_flag(fi, FI_NEED_IPU);
-
 	ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
-	if (datasync)
-		clear_inode_flag(fi, FI_NEED_IPU);
 	if (ret) {
 		trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret);
 		return ret;
 	}
 
-	/*
-	 * if there is no written data, don't waste time to write recovery info.
-	 */
-	if (!is_inode_flag_set(fi, FI_APPEND_WRITE) &&
-		!exist_written_data(sbi, inode->i_ino, APPEND_INO)) {
-		if (is_inode_flag_set(fi, FI_UPDATE_WRITE) ||
-			exist_written_data(sbi, inode->i_ino, UPDATE_INO))
-			goto flush_out;
-		goto out;
-	}
-
 	/* guarantee free sections for fsync */
 	f2fs_balance_fs(sbi);
 
@@ -203,13 +185,6 @@
 		ret = wait_on_node_pages_writeback(sbi, inode->i_ino);
 		if (ret)
 			goto out;
-
-		/* once recovery info is written, don't need to tack this */
-		remove_dirty_inode(sbi, inode->i_ino, APPEND_INO);
-		clear_inode_flag(fi, FI_APPEND_WRITE);
-flush_out:
-		remove_dirty_inode(sbi, inode->i_ino, UPDATE_INO);
-		clear_inode_flag(fi, FI_UPDATE_WRITE);
 		ret = f2fs_issue_flush(F2FS_SB(inode->i_sb));
 	}
 out:
@@ -228,9 +203,8 @@
 
 	/* find first dirty page index */
 	pagevec_init(&pvec, 0);
-	nr_pages = pagevec_lookup_tag(&pvec, mapping, &pgofs,
-					PAGECACHE_TAG_DIRTY, 1);
-	pgofs = nr_pages ? pvec.pages[0]->index : LONG_MAX;
+	nr_pages = pagevec_lookup_tag(&pvec, mapping, &pgofs, PAGECACHE_TAG_DIRTY, 1);
+	pgofs = nr_pages ? pvec.pages[0]->index: LONG_MAX;
 	pagevec_release(&pvec);
 	return pgofs;
 }
@@ -687,8 +661,6 @@
 	loff_t off_start, off_end;
 	int ret = 0;
 
-	f2fs_balance_fs(sbi);
-
 	ret = inode_newsize_ok(inode, (len + offset));
 	if (ret)
 		return ret;