Skip to content

Commit 92f750d

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: convert f2fs__page tracepoint class to use folio
Convert f2fs__page tracepoint class() and its instances to use folio and related functionality, and rename it to f2fs__folio(). Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
1 parent 96ea46f commit 92f750d

4 files changed

Lines changed: 30 additions & 30 deletions

File tree

fs/f2fs/checkpoint.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ static int __f2fs_write_meta_page(struct page *page,
345345
{
346346
struct f2fs_sb_info *sbi = F2FS_P_SB(page);
347347

348-
trace_f2fs_writepage(page, META);
348+
trace_f2fs_writepage(page_folio(page), META);
349349

350350
if (unlikely(f2fs_cp_error(sbi))) {
351351
if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) {
@@ -492,7 +492,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
492492
static bool f2fs_dirty_meta_folio(struct address_space *mapping,
493493
struct folio *folio)
494494
{
495-
trace_f2fs_set_page_dirty(&folio->page, META);
495+
trace_f2fs_set_page_dirty(folio, META);
496496

497497
if (!folio_test_uptodate(folio))
498498
folio_mark_uptodate(folio);

fs/f2fs/data.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2461,7 +2461,7 @@ static int f2fs_read_data_folio(struct file *file, struct folio *folio)
24612461
struct inode *inode = folio_file_mapping(folio)->host;
24622462
int ret = -EAGAIN;
24632463

2464-
trace_f2fs_readpage(&folio->page, DATA);
2464+
trace_f2fs_readpage(folio, DATA);
24652465

24662466
if (!f2fs_is_compress_backend_ready(inode)) {
24672467
folio_unlock(folio);
@@ -2710,7 +2710,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
27102710
} else {
27112711
set_inode_flag(inode, FI_UPDATE_WRITE);
27122712
}
2713-
trace_f2fs_do_write_data_page(fio->page, IPU);
2713+
trace_f2fs_do_write_data_page(page_folio(page), IPU);
27142714
return err;
27152715
}
27162716

@@ -2739,7 +2739,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
27392739

27402740
/* LFS mode write path */
27412741
f2fs_outplace_write_data(&dn, fio);
2742-
trace_f2fs_do_write_data_page(page, OPU);
2742+
trace_f2fs_do_write_data_page(page_folio(page), OPU);
27432743
set_inode_flag(inode, FI_APPEND_WRITE);
27442744
out_writepage:
27452745
f2fs_put_dnode(&dn);
@@ -2786,7 +2786,7 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
27862786
.last_block = last_block,
27872787
};
27882788

2789-
trace_f2fs_writepage(page, DATA);
2789+
trace_f2fs_writepage(page_folio(page), DATA);
27902790

27912791
/* we should bypass data pages to proceed the kworker jobs */
27922792
if (unlikely(f2fs_cp_error(sbi))) {
@@ -3760,7 +3760,7 @@ static bool f2fs_dirty_data_folio(struct address_space *mapping,
37603760
{
37613761
struct inode *inode = mapping->host;
37623762

3763-
trace_f2fs_set_page_dirty(&folio->page, DATA);
3763+
trace_f2fs_set_page_dirty(folio, DATA);
37643764

37653765
if (!folio_test_uptodate(folio))
37663766
folio_mark_uptodate(folio);

fs/f2fs/node.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,7 +1624,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
16241624
};
16251625
unsigned int seq;
16261626

1627-
trace_f2fs_writepage(page, NODE);
1627+
trace_f2fs_writepage(page_folio(page), NODE);
16281628

16291629
if (unlikely(f2fs_cp_error(sbi))) {
16301630
/* keep node pages in remount-ro mode */
@@ -2171,7 +2171,7 @@ static int f2fs_write_node_pages(struct address_space *mapping,
21712171
static bool f2fs_dirty_node_folio(struct address_space *mapping,
21722172
struct folio *folio)
21732173
{
2174-
trace_f2fs_set_page_dirty(&folio->page, NODE);
2174+
trace_f2fs_set_page_dirty(folio, NODE);
21752175

21762176
if (!folio_test_uptodate(folio))
21772177
folio_mark_uptodate(folio);

include/trace/events/f2fs.h

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,11 +1304,11 @@ TRACE_EVENT(f2fs_write_end,
13041304
__entry->copied)
13051305
);
13061306

1307-
DECLARE_EVENT_CLASS(f2fs__page,
1307+
DECLARE_EVENT_CLASS(f2fs__folio,
13081308

1309-
TP_PROTO(struct page *page, int type),
1309+
TP_PROTO(struct folio *folio, int type),
13101310

1311-
TP_ARGS(page, type),
1311+
TP_ARGS(folio, type),
13121312

13131313
TP_STRUCT__entry(
13141314
__field(dev_t, dev)
@@ -1321,14 +1321,14 @@ DECLARE_EVENT_CLASS(f2fs__page,
13211321
),
13221322

13231323
TP_fast_assign(
1324-
__entry->dev = page_file_mapping(page)->host->i_sb->s_dev;
1325-
__entry->ino = page_file_mapping(page)->host->i_ino;
1324+
__entry->dev = folio_file_mapping(folio)->host->i_sb->s_dev;
1325+
__entry->ino = folio_file_mapping(folio)->host->i_ino;
13261326
__entry->type = type;
13271327
__entry->dir =
1328-
S_ISDIR(page_file_mapping(page)->host->i_mode);
1329-
__entry->index = page->index;
1330-
__entry->dirty = PageDirty(page);
1331-
__entry->uptodate = PageUptodate(page);
1328+
S_ISDIR(folio_file_mapping(folio)->host->i_mode);
1329+
__entry->index = folio_index(folio);
1330+
__entry->dirty = folio_test_dirty(folio);
1331+
__entry->uptodate = folio_test_uptodate(folio);
13321332
),
13331333

13341334
TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
@@ -1341,32 +1341,32 @@ DECLARE_EVENT_CLASS(f2fs__page,
13411341
__entry->uptodate)
13421342
);
13431343

1344-
DEFINE_EVENT(f2fs__page, f2fs_writepage,
1344+
DEFINE_EVENT(f2fs__folio, f2fs_writepage,
13451345

1346-
TP_PROTO(struct page *page, int type),
1346+
TP_PROTO(struct folio *folio, int type),
13471347

1348-
TP_ARGS(page, type)
1348+
TP_ARGS(folio, type)
13491349
);
13501350

1351-
DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page,
1351+
DEFINE_EVENT(f2fs__folio, f2fs_do_write_data_page,
13521352

1353-
TP_PROTO(struct page *page, int type),
1353+
TP_PROTO(struct folio *folio, int type),
13541354

1355-
TP_ARGS(page, type)
1355+
TP_ARGS(folio, type)
13561356
);
13571357

1358-
DEFINE_EVENT(f2fs__page, f2fs_readpage,
1358+
DEFINE_EVENT(f2fs__folio, f2fs_readpage,
13591359

1360-
TP_PROTO(struct page *page, int type),
1360+
TP_PROTO(struct folio *folio, int type),
13611361

1362-
TP_ARGS(page, type)
1362+
TP_ARGS(folio, type)
13631363
);
13641364

1365-
DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
1365+
DEFINE_EVENT(f2fs__folio, f2fs_set_page_dirty,
13661366

1367-
TP_PROTO(struct page *page, int type),
1367+
TP_PROTO(struct folio *folio, int type),
13681368

1369-
TP_ARGS(page, type)
1369+
TP_ARGS(folio, type)
13701370
);
13711371

13721372
TRACE_EVENT(f2fs_replace_atomic_write_block,

0 commit comments

Comments
 (0)