From: Gao Xiang Date: Thu, 17 Aug 2023 08:39:42 +0000 (+0800) Subject: erofs: adapt folios for z_erofs_read_folio() X-Git-Tag: v6.1.146~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=911e9c469db4ef324bd0971890b81071610ab4f3;p=thirdparty%2Fkernel%2Fstable.git erofs: adapt folios for z_erofs_read_folio() [ Upstream commit c33ad3b2b7100ac944aad38d3ebc89cb5f654e94 ] It's a straight-forward conversion and no logic changes (except that it renames the corresponding tracepoint.) Reviewed-by: Chao Yu Signed-off-by: Gao Xiang Link: https://lore.kernel.org/r/20230817083942.103303-1-hsiangkao@linux.alibaba.com Stable-dep-of: 99f7619a77a0 ("erofs: fix to add missing tracepoint in erofs_read_folio()") Signed-off-by: Sasha Levin --- diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index ac8c082798512..32ca6d3e373ab 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -1680,17 +1680,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); (void)z_erofs_collector_end(&f); diff --git a/include/trace/events/erofs.h b/include/trace/events/erofs.h index a5e7f79ba557f..54a876f52e9b4 100644 --- a/include/trace/events/erofs.h +++ b/include/trace/events/erofs.h @@ -75,11 +75,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 ) @@ -91,11 +91,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; ),