Commit 92f750d8 authored by Chao Yu's avatar Chao Yu Committed by Jaegeuk Kim

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: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 96ea46f3
...@@ -345,7 +345,7 @@ static int __f2fs_write_meta_page(struct page *page, ...@@ -345,7 +345,7 @@ static int __f2fs_write_meta_page(struct page *page,
{ {
struct f2fs_sb_info *sbi = F2FS_P_SB(page); struct f2fs_sb_info *sbi = F2FS_P_SB(page);
trace_f2fs_writepage(page, META); trace_f2fs_writepage(page_folio(page), META);
if (unlikely(f2fs_cp_error(sbi))) { if (unlikely(f2fs_cp_error(sbi))) {
if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) { 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, ...@@ -492,7 +492,7 @@ long f2fs_sync_meta_pages(struct f2fs_sb_info *sbi, enum page_type type,
static bool f2fs_dirty_meta_folio(struct address_space *mapping, static bool f2fs_dirty_meta_folio(struct address_space *mapping,
struct folio *folio) struct folio *folio)
{ {
trace_f2fs_set_page_dirty(&folio->page, META); trace_f2fs_set_page_dirty(folio, META);
if (!folio_test_uptodate(folio)) if (!folio_test_uptodate(folio))
folio_mark_uptodate(folio); folio_mark_uptodate(folio);
......
...@@ -2461,7 +2461,7 @@ static int f2fs_read_data_folio(struct file *file, struct folio *folio) ...@@ -2461,7 +2461,7 @@ static int f2fs_read_data_folio(struct file *file, struct folio *folio)
struct inode *inode = folio_file_mapping(folio)->host; struct inode *inode = folio_file_mapping(folio)->host;
int ret = -EAGAIN; int ret = -EAGAIN;
trace_f2fs_readpage(&folio->page, DATA); trace_f2fs_readpage(folio, DATA);
if (!f2fs_is_compress_backend_ready(inode)) { if (!f2fs_is_compress_backend_ready(inode)) {
folio_unlock(folio); folio_unlock(folio);
...@@ -2710,7 +2710,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio) ...@@ -2710,7 +2710,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
} else { } else {
set_inode_flag(inode, FI_UPDATE_WRITE); set_inode_flag(inode, FI_UPDATE_WRITE);
} }
trace_f2fs_do_write_data_page(fio->page, IPU); trace_f2fs_do_write_data_page(page_folio(page), IPU);
return err; return err;
} }
...@@ -2739,7 +2739,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio) ...@@ -2739,7 +2739,7 @@ int f2fs_do_write_data_page(struct f2fs_io_info *fio)
/* LFS mode write path */ /* LFS mode write path */
f2fs_outplace_write_data(&dn, fio); f2fs_outplace_write_data(&dn, fio);
trace_f2fs_do_write_data_page(page, OPU); trace_f2fs_do_write_data_page(page_folio(page), OPU);
set_inode_flag(inode, FI_APPEND_WRITE); set_inode_flag(inode, FI_APPEND_WRITE);
out_writepage: out_writepage:
f2fs_put_dnode(&dn); f2fs_put_dnode(&dn);
...@@ -2786,7 +2786,7 @@ int f2fs_write_single_data_page(struct page *page, int *submitted, ...@@ -2786,7 +2786,7 @@ int f2fs_write_single_data_page(struct page *page, int *submitted,
.last_block = last_block, .last_block = last_block,
}; };
trace_f2fs_writepage(page, DATA); trace_f2fs_writepage(page_folio(page), DATA);
/* we should bypass data pages to proceed the kworker jobs */ /* we should bypass data pages to proceed the kworker jobs */
if (unlikely(f2fs_cp_error(sbi))) { if (unlikely(f2fs_cp_error(sbi))) {
...@@ -3760,7 +3760,7 @@ static bool f2fs_dirty_data_folio(struct address_space *mapping, ...@@ -3760,7 +3760,7 @@ static bool f2fs_dirty_data_folio(struct address_space *mapping,
{ {
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
trace_f2fs_set_page_dirty(&folio->page, DATA); trace_f2fs_set_page_dirty(folio, DATA);
if (!folio_test_uptodate(folio)) if (!folio_test_uptodate(folio))
folio_mark_uptodate(folio); folio_mark_uptodate(folio);
......
...@@ -1624,7 +1624,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted, ...@@ -1624,7 +1624,7 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
}; };
unsigned int seq; unsigned int seq;
trace_f2fs_writepage(page, NODE); trace_f2fs_writepage(page_folio(page), NODE);
if (unlikely(f2fs_cp_error(sbi))) { if (unlikely(f2fs_cp_error(sbi))) {
/* keep node pages in remount-ro mode */ /* keep node pages in remount-ro mode */
...@@ -2171,7 +2171,7 @@ static int f2fs_write_node_pages(struct address_space *mapping, ...@@ -2171,7 +2171,7 @@ static int f2fs_write_node_pages(struct address_space *mapping,
static bool f2fs_dirty_node_folio(struct address_space *mapping, static bool f2fs_dirty_node_folio(struct address_space *mapping,
struct folio *folio) struct folio *folio)
{ {
trace_f2fs_set_page_dirty(&folio->page, NODE); trace_f2fs_set_page_dirty(folio, NODE);
if (!folio_test_uptodate(folio)) if (!folio_test_uptodate(folio))
folio_mark_uptodate(folio); folio_mark_uptodate(folio);
......
...@@ -1304,11 +1304,11 @@ TRACE_EVENT(f2fs_write_end, ...@@ -1304,11 +1304,11 @@ TRACE_EVENT(f2fs_write_end,
__entry->copied) __entry->copied)
); );
DECLARE_EVENT_CLASS(f2fs__page, DECLARE_EVENT_CLASS(f2fs__folio,
TP_PROTO(struct page *page, int type), TP_PROTO(struct folio *folio, int type),
TP_ARGS(page, type), TP_ARGS(folio, type),
TP_STRUCT__entry( TP_STRUCT__entry(
__field(dev_t, dev) __field(dev_t, dev)
...@@ -1321,14 +1321,14 @@ DECLARE_EVENT_CLASS(f2fs__page, ...@@ -1321,14 +1321,14 @@ DECLARE_EVENT_CLASS(f2fs__page,
), ),
TP_fast_assign( TP_fast_assign(
__entry->dev = page_file_mapping(page)->host->i_sb->s_dev; __entry->dev = folio_file_mapping(folio)->host->i_sb->s_dev;
__entry->ino = page_file_mapping(page)->host->i_ino; __entry->ino = folio_file_mapping(folio)->host->i_ino;
__entry->type = type; __entry->type = type;
__entry->dir = __entry->dir =
S_ISDIR(page_file_mapping(page)->host->i_mode); S_ISDIR(folio_file_mapping(folio)->host->i_mode);
__entry->index = page->index; __entry->index = folio_index(folio);
__entry->dirty = PageDirty(page); __entry->dirty = folio_test_dirty(folio);
__entry->uptodate = PageUptodate(page); __entry->uptodate = folio_test_uptodate(folio);
), ),
TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, " TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
...@@ -1341,32 +1341,32 @@ DECLARE_EVENT_CLASS(f2fs__page, ...@@ -1341,32 +1341,32 @@ DECLARE_EVENT_CLASS(f2fs__page,
__entry->uptodate) __entry->uptodate)
); );
DEFINE_EVENT(f2fs__page, f2fs_writepage, DEFINE_EVENT(f2fs__folio, f2fs_writepage,
TP_PROTO(struct page *page, int type), TP_PROTO(struct folio *folio, int type),
TP_ARGS(page, type) TP_ARGS(folio, type)
); );
DEFINE_EVENT(f2fs__page, f2fs_do_write_data_page, DEFINE_EVENT(f2fs__folio, f2fs_do_write_data_page,
TP_PROTO(struct page *page, int type), TP_PROTO(struct folio *folio, int type),
TP_ARGS(page, type) TP_ARGS(folio, type)
); );
DEFINE_EVENT(f2fs__page, f2fs_readpage, DEFINE_EVENT(f2fs__folio, f2fs_readpage,
TP_PROTO(struct page *page, int type), TP_PROTO(struct folio *folio, int type),
TP_ARGS(page, type) TP_ARGS(folio, type)
); );
DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, DEFINE_EVENT(f2fs__folio, f2fs_set_page_dirty,
TP_PROTO(struct page *page, int type), TP_PROTO(struct folio *folio, int type),
TP_ARGS(page, type) TP_ARGS(folio, type)
); );
TRACE_EVENT(f2fs_replace_atomic_write_block, TRACE_EVENT(f2fs_replace_atomic_write_block,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment