aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHuang Ying <ying.huang@intel.com>2014-07-12 08:10:00 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-25 11:13:58 -0400
commit79e35dc3c23dd2ac9f8681361026c82b71a0b006 (patch)
treeb39f183f6e6ef4c4863db07aa76b989812786467
parentf1121ab0ba9ab9c1592049533b511877600f409e (diff)
f2fs: add f2fs_balance_fs for direct IO
Otherwise, if a large amount of direct IO writes were done, the segment allocation may be failed because no enough segments are gced. Changes: v2: add f2fs_balance_fs into __get_data_block instead of f2fs_direct_IO. Signed-off-by: Huang, Ying <ying.huang@intel.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 05154d6de49a..c77c66723d70 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -626,8 +626,10 @@ static int __get_data_block(struct inode *inode, sector_t iblock,
626 if (check_extent_cache(inode, pgofs, bh_result)) 626 if (check_extent_cache(inode, pgofs, bh_result))
627 goto out; 627 goto out;
628 628
629 if (create) 629 if (create) {
630 f2fs_balance_fs(sbi);
630 f2fs_lock_op(sbi); 631 f2fs_lock_op(sbi);
632 }
631 633
632 /* When reading holes, we need its node page */ 634 /* When reading holes, we need its node page */
633 set_new_dnode(&dn, inode, NULL, NULL, 0); 635 set_new_dnode(&dn, inode, NULL, NULL, 0);