summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/f2fs/checkpoint.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 56bbf592e487..5b876f6d3f6b 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -879,6 +879,7 @@ int sync_dirty_inodes(struct f2fs_sb_info *sbi, enum inode_type type)
879 struct inode *inode; 879 struct inode *inode;
880 struct f2fs_inode_info *fi; 880 struct f2fs_inode_info *fi;
881 bool is_dir = (type == DIR_INODE); 881 bool is_dir = (type == DIR_INODE);
882 unsigned long ino = 0;
882 883
883 trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir, 884 trace_f2fs_sync_dirty_inodes_enter(sbi->sb, is_dir,
884 get_pages(sbi, is_dir ? 885 get_pages(sbi, is_dir ?
@@ -901,8 +902,17 @@ retry:
901 inode = igrab(&fi->vfs_inode); 902 inode = igrab(&fi->vfs_inode);
902 spin_unlock(&sbi->inode_lock[type]); 903 spin_unlock(&sbi->inode_lock[type]);
903 if (inode) { 904 if (inode) {
905 unsigned long cur_ino = inode->i_ino;
906
904 filemap_fdatawrite(inode->i_mapping); 907 filemap_fdatawrite(inode->i_mapping);
905 iput(inode); 908 iput(inode);
909 /* We need to give cpu to another writers. */
910 if (ino == cur_ino) {
911 congestion_wait(BLK_RW_ASYNC, HZ/50);
912 cond_resched();
913 } else {
914 ino = cur_ino;
915 }
906 } else { 916 } else {
907 /* 917 /*
908 * We should submit bio, since it exists several 918 * We should submit bio, since it exists several