Skip to content

Commit c33ad3b

Browse files
committed
erofs: adapt folios for z_erofs_read_folio()
It's a straight-forward conversion and no logic changes (except that it renames the corresponding tracepoint.) Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Gao Xiang <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 491b110 commit c33ad3b

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

fs/erofs/zdata.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1822,17 +1822,16 @@ static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,
18221822

18231823
static int z_erofs_read_folio(struct file *file, struct folio *folio)
18241824
{
1825-
struct page *page = &folio->page;
1826-
struct inode *const inode = page->mapping->host;
1825+
struct inode *const inode = folio->mapping->host;
18271826
struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
18281827
struct z_erofs_decompress_frontend f = DECOMPRESS_FRONTEND_INIT(inode);
18291828
int err;
18301829

1831-
trace_erofs_readpage(page, false);
1832-
f.headoffset = (erofs_off_t)page->index << PAGE_SHIFT;
1830+
trace_erofs_read_folio(folio, false);
1831+
f.headoffset = (erofs_off_t)folio->index << PAGE_SHIFT;
18331832

18341833
z_erofs_pcluster_readmore(&f, NULL, true);
1835-
err = z_erofs_do_read_page(&f, page);
1834+
err = z_erofs_do_read_page(&f, &folio->page);
18361835
z_erofs_pcluster_readmore(&f, NULL, false);
18371836
z_erofs_pcluster_end(&f);
18381837

include/trace/events/erofs.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ TRACE_EVENT(erofs_fill_inode,
8080
__entry->blkaddr, __entry->ofs)
8181
);
8282

83-
TRACE_EVENT(erofs_readpage,
83+
TRACE_EVENT(erofs_read_folio,
8484

85-
TP_PROTO(struct page *page, bool raw),
85+
TP_PROTO(struct folio *folio, bool raw),
8686

87-
TP_ARGS(page, raw),
87+
TP_ARGS(folio, raw),
8888

8989
TP_STRUCT__entry(
9090
__field(dev_t, dev )
@@ -96,11 +96,11 @@ TRACE_EVENT(erofs_readpage,
9696
),
9797

9898
TP_fast_assign(
99-
__entry->dev = page->mapping->host->i_sb->s_dev;
100-
__entry->nid = EROFS_I(page->mapping->host)->nid;
101-
__entry->dir = S_ISDIR(page->mapping->host->i_mode);
102-
__entry->index = page->index;
103-
__entry->uptodate = PageUptodate(page);
99+
__entry->dev = folio->mapping->host->i_sb->s_dev;
100+
__entry->nid = EROFS_I(folio->mapping->host)->nid;
101+
__entry->dir = S_ISDIR(folio->mapping->host->i_mode);
102+
__entry->index = folio->index;
103+
__entry->uptodate = folio_test_uptodate(folio);
104104
__entry->raw = raw;
105105
),
106106

0 commit comments

Comments
 (0)