Skip to content

Commit f7b929e

Browse files
zangyangyang666Jaegeuk Kim
authored andcommitted
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>
1 parent e48e16f commit f7b929e

3 files changed

Lines changed: 10 additions & 11 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
534534

535535
trace_f2fs_writepages(mapping->host, wbc, META);
536536
diff = nr_pages_to_write(sbi, META, wbc);
537-
written = f2fs_sync_meta_pages(sbi, META, wbc->nr_to_write, FS_META_IO);
537+
written = f2fs_sync_meta_pages(sbi, wbc->nr_to_write, FS_META_IO);
538538
f2fs_up_write_trace(&sbi->cp_global_sem, &lc);
539539
wbc->nr_to_write = max((long)0, wbc->nr_to_write - written - diff);
540540
return 0;
@@ -545,8 +545,8 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
545545
return 0;
546546
}
547547

548-
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
549-
long nr_to_write, enum iostat_type io_type)
548+
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, long nr_to_write,
549+
enum iostat_type io_type)
550550
{
551551
struct address_space *mapping = META_MAPPING(sbi);
552552
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,
607607
}
608608
stop:
609609
if (nwritten)
610-
f2fs_submit_merged_write(sbi, type);
610+
f2fs_submit_merged_write(sbi, META);
611611

612612
blk_finish_plug(&plug);
613613

@@ -1450,8 +1450,7 @@ void f2fs_wait_on_all_pages(struct f2fs_sb_info *sbi, int type)
14501450
break;
14511451

14521452
if (type == F2FS_DIRTY_META)
1453-
f2fs_sync_meta_pages(sbi, META, LONG_MAX,
1454-
FS_CP_META_IO);
1453+
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
14551454
else if (type == F2FS_WB_CP_DATA)
14561455
f2fs_submit_merged_write(sbi, DATA);
14571456

@@ -1623,7 +1622,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
16231622
int err;
16241623

16251624
/* Flush all the NAT/SIT pages */
1626-
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
1625+
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
16271626

16281627
stat_cp_time(cpc, CP_TIME_SYNC_META);
16291628

@@ -1722,7 +1721,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
17221721
}
17231722

17241723
/* Here, we have one bio having CP pack except cp pack 2 page */
1725-
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_CP_META_IO);
1724+
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_CP_META_IO);
17261725
stat_cp_time(cpc, CP_TIME_SYNC_CP_META);
17271726

17281727
/* Wait for all dirty meta pages to be submitted for IO */

fs/f2fs/f2fs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4068,8 +4068,8 @@ int f2fs_ra_meta_pages(struct f2fs_sb_info *sbi, block_t start, int nrpages,
40684068
int type, bool sync);
40694069
void f2fs_ra_meta_pages_cond(struct f2fs_sb_info *sbi, pgoff_t index,
40704070
unsigned int ra_blocks);
4071-
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
4072-
long nr_to_write, enum iostat_type io_type);
4071+
long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, long nr_to_write,
4072+
enum iostat_type io_type);
40734073
void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
40744074
void f2fs_remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type);
40754075
void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all);

fs/f2fs/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2463,7 +2463,7 @@ int f2fs_do_shutdown(struct f2fs_sb_info *sbi, unsigned int flag,
24632463
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_SHUTDOWN);
24642464
break;
24652465
case F2FS_GOING_DOWN_METAFLUSH:
2466-
f2fs_sync_meta_pages(sbi, META, LONG_MAX, FS_META_IO);
2466+
f2fs_sync_meta_pages(sbi, LONG_MAX, FS_META_IO);
24672467
f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_SHUTDOWN);
24682468
break;
24692469
case F2FS_GOING_DOWN_NEED_FSCK:

0 commit comments

Comments
 (0)