Skip to content

Commit

Permalink
erofs: adapt folios for z_erofs_read_folio()
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
hsiangkao committed Aug 23, 2023
1 parent 491b110 commit c33ad3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
9 changes: 4 additions & 5 deletions fs/erofs/zdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1822,17 +1822,16 @@ static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,

static int z_erofs_read_folio(struct file *file, struct folio *folio)
{
struct page *page = &folio->page;
struct inode *const inode = page->mapping->host;
struct inode *const inode = folio->mapping->host;
struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
struct z_erofs_decompress_frontend f = DECOMPRESS_FRONTEND_INIT(inode);
int err;

trace_erofs_readpage(page, false);
f.headoffset = (erofs_off_t)page->index << PAGE_SHIFT;
trace_erofs_read_folio(folio, false);
f.headoffset = (erofs_off_t)folio->index << PAGE_SHIFT;

z_erofs_pcluster_readmore(&f, NULL, true);
err = z_erofs_do_read_page(&f, page);
err = z_erofs_do_read_page(&f, &folio->page);
z_erofs_pcluster_readmore(&f, NULL, false);
z_erofs_pcluster_end(&f);

Expand Down
16 changes: 8 additions & 8 deletions include/trace/events/erofs.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ TRACE_EVENT(erofs_fill_inode,
__entry->blkaddr, __entry->ofs)
);

TRACE_EVENT(erofs_readpage,
TRACE_EVENT(erofs_read_folio,

TP_PROTO(struct page *page, bool raw),
TP_PROTO(struct folio *folio, bool raw),

TP_ARGS(page, raw),
TP_ARGS(folio, raw),

TP_STRUCT__entry(
__field(dev_t, dev )
Expand All @@ -96,11 +96,11 @@ TRACE_EVENT(erofs_readpage,
),

TP_fast_assign(
__entry->dev = page->mapping->host->i_sb->s_dev;
__entry->nid = EROFS_I(page->mapping->host)->nid;
__entry->dir = S_ISDIR(page->mapping->host->i_mode);
__entry->index = page->index;
__entry->uptodate = PageUptodate(page);
__entry->dev = folio->mapping->host->i_sb->s_dev;
__entry->nid = EROFS_I(folio->mapping->host)->nid;
__entry->dir = S_ISDIR(folio->mapping->host->i_mode);
__entry->index = folio->index;
__entry->uptodate = folio_test_uptodate(folio);
__entry->raw = raw;
),

Expand Down

0 comments on commit c33ad3b

Please sign in to comment.