mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 09:04:39 +02:00
f2fs: clean up the type parameter in f2fs_sync_meta_pages()
Clean up code to improve readability, no logic changes. Signed-off-by: Yangyang Zang <zangyangyang1@xiaomi.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
e48e16f3e3
commit
f7b929eda1
|
|
@ -534,7 +534,7 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
|
|||
|
||||
trace_f2fs_writepages(mapping->host, wbc, META);
|
||||
diff = nr_pages_to_write(sbi, META, wbc);
|
||||
written = f2fs_sync_meta_pages(sbi, META, wbc->nr_to_write, FS_META_IO);
|
||||
written = f2fs_sync_meta_pages(sbi, wbc->nr_to_write, FS_META_IO);
|
||||
f2fs_up_write_trace(&sbi->cp_global_sem, &lc);
|
||||
wbc->nr_to_write = max((long)0, wbc->nr_to_write - written - diff);
|
||||
return 0;
|
||||
|
|
@ -545,8 +545,8 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
|
|||
return 0;
|
||||
}
|
||||
|
||||
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
|
||||
long nr_to_write, enum iostat_type io_type)
|
||||
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, long nr_to_write,
|
||||
enum iostat_type io_type)
|
||||
{
|
||||
struct address_space *mapping = META_MAPPING(sbi);
|
||||
pgoff_t index = 0, prev = ULONG_MAX;
|
||||
|
|
@ -607,7 +607,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
|
|||
}
|
||||
stop:
|
||||
if (nwritten)
|
||||
f2fs_submit_merged_write(sbi, type);
|
||||
f2fs_submit_merged_write(sbi, META);
|
||||
|
||||
blk_finish_plug(&plug);
|
||||
|
||||
|
|
@ -1450,8 +1450,7 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type)
|
|||
break;
|
||||
|
||||
if (type == F2FS_DIRTY_META)
|
||||
f2fs_sync_meta_pages(sbi, META, LONG_MAX,
|
||||
FS_CP_META_IO);
|
||||
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
|
||||
else if (type == F2FS_WB_CP_DATA)
|
||||
f2fs_submit_merged_write(sbi, DATA);
|
||||
|
||||
|
|
@ -1623,7 +1622,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
int err;
|
||||
|
||||
/* Flush all the NAT/SIT pages */
|
||||
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
|
||||
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
|
||||
|
||||
stat_cp_time(cpc, CP_TIME_SYNC_META);
|
||||
|
||||
|
|
@ -1722,7 +1721,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
|||
}
|
||||
|
||||
/* Here, we have one bio having CP pack except cp pack 2 page */
|
||||
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
|
||||
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
|
||||
stat_cp_time(cpc, CP_TIME_SYNC_CP_META);
|
||||
|
||||
/* Wait for all dirty meta pages to be submitted for IO */
|
||||
|
|
|
|||
|
|
@ -4068,8 +4068,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
|
|||
int type, bool sync);
|
||||
void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index,
|
||||
unsigned int ra_blocks);
|
||||
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
|
||||
long nr_to_write, enum iostat_type io_type);
|
||||
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, long nr_to_write,
|
||||
enum iostat_type io_type);
|
||||
void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
|
||||
void f2fs_remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
|
||||
void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all);
|
||||
|
|
|
|||
|
|
@ -2463,7 +2463,7 @@ int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,
|
|||
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_SHUTDOWN);
|
||||
break;
|
||||
case F2FS_GOING_DOWN_METAFLUSH:
|
||||
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_META_IO);
|
||||
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_META_IO);
|
||||
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_SHUTDOWN);
|
||||
break;
|
||||
case F2FS_GOING_DOWN_NEED_FSCK:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user