Skip to contentSkip to conversation

f2fs: Add f2fs_balance_fs for direct IO

PATCH In review Huang Ying 3 participants 3 messages Jul 12, 2014 – Jul 26, 2014 F2FS file system

lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH v2 1/1 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.

---
 fs/f2fs/data.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/f2fs/data.c +3 -1
@@ -626,8 +626,10 @@ static int __get_data_block(struct inode
 	if (check_extent_cache(inode, pgofs, bh_result))
 		goto out;
 
-	if (create)
+	if (create) {
+		f2fs_balance_fs(sbi);
 		f2fs_lock_op(sbi);
+	}
 
 	/* When reading holes, we need its node page */
 	set_new_dnode(&dn, inode, NULL, NULL, 0);
#1 lore raw

Hi, Jaegeuk,

Do you have time to take a look at this patch?

Best Regards,
Huang, Ying

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and search up to 200,000 lines of code with a free copy of Black Duck Code Sight - the same software that powers the world's largest code search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds

_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

maintainer
#2 lore raw

Hi Huang,

Quoted 3 lines · huang ying

Hi, Jaegeuk,

Do you have time to take a look at this patch?

I merged this in my local tree. :)
Thanks,

Quoted 3 lines

Best Regards,
Huang, Ying