In f2fs, we don't need to keep block plugging for NODE and DATA writes, since
we already merged bios as much as possible.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
.nr_to_write = LONG_MAX,
.for_reclaim = 0,
};
.nr_to_write = LONG_MAX,
.for_reclaim = 0,
};
- blk_start_plug(&plug);
-
retry_flush_dents:
f2fs_lock_all(sbi);
/* write all the dirty dentry pages */
retry_flush_dents:
f2fs_lock_all(sbi);
/* write all the dirty dentry pages */
goto retry_flush_nodes;
}
out:
goto retry_flush_nodes;
}
out:
- blk_finish_plug(&plug);
}
static inline void __submit_bio(struct f2fs_sb_info *sbi, int rw,
}
static inline void __submit_bio(struct f2fs_sb_info *sbi, int rw,
+ struct bio *bio, enum page_type type)
atomic_inc(&sbi->nr_wb_bios);
atomic_inc(&sbi->nr_wb_bios);
+ if (current->plug && (type == DATA || type == NODE))
+ blk_finish_plug(current->plug);
+ }
else
trace_f2fs_submit_write_bio(io->sbi->sb, fio, io->bio);
else
trace_f2fs_submit_write_bio(io->sbi->sb, fio, io->bio);
- __submit_bio(io->sbi, fio->rw, io->bio);
+ __submit_bio(io->sbi, fio->rw, io->bio, fio->type);
- __submit_bio(fio->sbi, fio->rw, bio);
+ __submit_bio(fio->sbi, fio->rw, bio, fio->type);
*/
if (bio && (last_block_in_bio != block_nr - 1)) {
submit_and_realloc:
*/
if (bio && (last_block_in_bio != block_nr - 1)) {
submit_and_realloc:
- __submit_bio(F2FS_I_SB(inode), READ, bio);
+ __submit_bio(F2FS_I_SB(inode), READ, bio, DATA);
bio = NULL;
}
if (bio == NULL) {
bio = NULL;
}
if (bio == NULL) {
goto next_page;
confused:
if (bio) {
goto next_page;
confused:
if (bio) {
- __submit_bio(F2FS_I_SB(inode), READ, bio);
+ __submit_bio(F2FS_I_SB(inode), READ, bio, DATA);
bio = NULL;
}
unlock_page(page);
bio = NULL;
}
unlock_page(page);
}
BUG_ON(pages && !list_empty(pages));
if (bio)
}
BUG_ON(pages && !list_empty(pages));
if (bio)
- __submit_bio(F2FS_I_SB(inode), READ, bio);
+ __submit_bio(F2FS_I_SB(inode), READ, bio, DATA);
{
struct page *sum_page;
struct f2fs_summary_block *sum;
{
struct page *sum_page;
struct f2fs_summary_block *sum;
unsigned int segno = start_segno;
unsigned int end_segno = start_segno + sbi->segs_per_sec;
int seg_freed = 0;
unsigned int segno = start_segno;
unsigned int end_segno = start_segno + sbi->segs_per_sec;
int seg_freed = 0;
- blk_start_plug(&plug);
-
for (segno = start_segno; segno < end_segno; segno++) {
/* find segment summary of victim */
sum_page = find_get_page(META_MAPPING(sbi),
for (segno = start_segno; segno < end_segno; segno++) {
/* find segment summary of victim */
sum_page = find_get_page(META_MAPPING(sbi),
f2fs_submit_merged_bio(sbi,
(type == SUM_TYPE_NODE) ? NODE : DATA, WRITE);
f2fs_submit_merged_bio(sbi,
(type == SUM_TYPE_NODE) ? NODE : DATA, WRITE);
- blk_finish_plug(&plug);
-
if (gc_type == FG_GC) {
while (start_segno < end_segno)
if (get_valid_blocks(sbi, start_segno++, 1) == 0)
if (gc_type == FG_GC) {
while (start_segno < end_segno)
if (get_valid_blocks(sbi, start_segno++, 1) == 0)
excess_prefree_segs(sbi) ||
excess_dirty_nats(sbi) ||
(is_idle(sbi) && f2fs_time_over(sbi, CP_TIME))) {
excess_prefree_segs(sbi) ||
excess_dirty_nats(sbi) ||
(is_idle(sbi) && f2fs_time_over(sbi, CP_TIME))) {
- if (test_opt(sbi, DATA_FLUSH)) {
- struct blk_plug plug;
-
- blk_start_plug(&plug);
+ if (test_opt(sbi, DATA_FLUSH))
sync_dirty_inodes(sbi, FILE_INODE);
sync_dirty_inodes(sbi, FILE_INODE);
- blk_finish_plug(&plug);
- }
f2fs_sync_fs(sbi->sb, true);
stat_inc_bg_cp_count(sbi->stat_info);
}
f2fs_sync_fs(sbi->sb, true);
stat_inc_bg_cp_count(sbi->stat_info);
}