All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: linux-fsdevel@vger.kernel.org
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>
Subject: [PATCH 36/69] fs: Convert iomap_readpage to iomap_read_folio
Date: Fri, 29 Apr 2022 18:25:23 +0100	[thread overview]
Message-ID: <20220429172556.3011843-37-willy@infradead.org> (raw)
In-Reply-To: <20220429172556.3011843-1-willy@infradead.org>

A straightforward conversion as iomap_readpage already worked in folios.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/erofs/data.c        |  6 +++---
 fs/gfs2/aops.c         |  3 ++-
 fs/iomap/buffered-io.c | 12 +++++-------
 fs/xfs/xfs_aops.c      |  8 ++++----
 fs/zonefs/super.c      |  6 +++---
 include/linux/iomap.h  |  2 +-
 6 files changed, 18 insertions(+), 19 deletions(-)

diff --git a/fs/erofs/data.c b/fs/erofs/data.c
index 780db1e5f4b7..2edca5669578 100644
--- a/fs/erofs/data.c
+++ b/fs/erofs/data.c
@@ -337,9 +337,9 @@ int erofs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
  * since we dont have write or truncate flows, so no inode
  * locking needs to be held at the moment.
  */
-static int erofs_readpage(struct file *file, struct page *page)
+static int erofs_read_folio(struct file *file, struct folio *folio)
 {
-	return iomap_readpage(page, &erofs_iomap_ops);
+	return iomap_read_folio(folio, &erofs_iomap_ops);
 }
 
 static void erofs_readahead(struct readahead_control *rac)
@@ -394,7 +394,7 @@ static ssize_t erofs_file_read_iter(struct kiocb *iocb, struct iov_iter *to)
 
 /* for uncompressed (aligned) files and raw access for other files */
 const struct address_space_operations erofs_raw_access_aops = {
-	.readpage = erofs_readpage,
+	.read_folio = erofs_read_folio,
 	.readahead = erofs_readahead,
 	.bmap = erofs_bmap,
 	.direct_IO = noop_direct_IO,
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 72c9f31ce724..a29eb1e5bfe2 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -467,6 +467,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
 
 static int __gfs2_readpage(void *file, struct page *page)
 {
+	struct folio *folio = page_folio(page);
 	struct inode *inode = page->mapping->host;
 	struct gfs2_inode *ip = GFS2_I(inode);
 	struct gfs2_sbd *sdp = GFS2_SB(inode);
@@ -474,7 +475,7 @@ static int __gfs2_readpage(void *file, struct page *page)
 
 	if (!gfs2_is_jdata(ip) ||
 	    (i_blocksize(inode) == PAGE_SIZE && !page_has_buffers(page))) {
-		error = iomap_readpage(page, &gfs2_iomap_ops);
+		error = iomap_read_folio(folio, &gfs2_iomap_ops);
 	} else if (gfs2_is_stuffed(ip)) {
 		error = stuffed_readpage(ip, page);
 		unlock_page(page);
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 8ce8720093b9..72f63d719c7c 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -320,10 +320,8 @@ static loff_t iomap_readpage_iter(const struct iomap_iter *iter,
 	return pos - orig_pos + plen;
 }
 
-int
-iomap_readpage(struct page *page, const struct iomap_ops *ops)
+int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops)
 {
-	struct folio *folio = page_folio(page);
 	struct iomap_iter iter = {
 		.inode		= folio->mapping->host,
 		.pos		= folio_pos(folio),
@@ -352,12 +350,12 @@ iomap_readpage(struct page *page, const struct iomap_ops *ops)
 
 	/*
 	 * Just like mpage_readahead and block_read_full_page, we always
-	 * return 0 and just mark the page as PageError on errors.  This
+	 * return 0 and just set the folio error flag on errors.  This
 	 * should be cleaned up throughout the stack eventually.
 	 */
 	return 0;
 }
-EXPORT_SYMBOL_GPL(iomap_readpage);
+EXPORT_SYMBOL_GPL(iomap_read_folio);
 
 static loff_t iomap_readahead_iter(const struct iomap_iter *iter,
 		struct iomap_readpage_ctx *ctx)
@@ -663,10 +661,10 @@ static size_t __iomap_write_end(struct inode *inode, loff_t pos, size_t len,
 
 	/*
 	 * The blocks that were entirely written will now be uptodate, so we
-	 * don't have to worry about a readpage reading them and overwriting a
+	 * don't have to worry about a read_folio reading them and overwriting a
 	 * partial write.  However, if we've encountered a short write and only
 	 * partially written into a block, it will not be marked uptodate, so a
-	 * readpage might come in and destroy our partial write.
+	 * read_folio might come in and destroy our partial write.
 	 *
 	 * Do the simplest thing and just treat any short write to a
 	 * non-uptodate page as a zero-length write, and force the caller to
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 90b7f4d127de..a9c4bb500d53 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -538,11 +538,11 @@ xfs_vm_bmap(
 }
 
 STATIC int
-xfs_vm_readpage(
+xfs_vm_read_folio(
 	struct file		*unused,
-	struct page		*page)
+	struct folio		*folio)
 {
-	return iomap_readpage(page, &xfs_read_iomap_ops);
+	return iomap_read_folio(folio, &xfs_read_iomap_ops);
 }
 
 STATIC void
@@ -564,7 +564,7 @@ xfs_iomap_swapfile_activate(
 }
 
 const struct address_space_operations xfs_address_space_operations = {
-	.readpage		= xfs_vm_readpage,
+	.read_folio		= xfs_vm_read_folio,
 	.readahead		= xfs_vm_readahead,
 	.writepages		= xfs_vm_writepages,
 	.dirty_folio		= filemap_dirty_folio,
diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
index e20e7c841489..c3a38f711b24 100644
--- a/fs/zonefs/super.c
+++ b/fs/zonefs/super.c
@@ -124,9 +124,9 @@ static const struct iomap_ops zonefs_iomap_ops = {
 	.iomap_begin	= zonefs_iomap_begin,
 };
 
-static int zonefs_readpage(struct file *unused, struct page *page)
+static int zonefs_read_folio(struct file *unused, struct folio *folio)
 {
-	return iomap_readpage(page, &zonefs_iomap_ops);
+	return iomap_read_folio(folio, &zonefs_iomap_ops);
 }
 
 static void zonefs_readahead(struct readahead_control *rac)
@@ -192,7 +192,7 @@ static int zonefs_swap_activate(struct swap_info_struct *sis,
 }
 
 static const struct address_space_operations zonefs_file_aops = {
-	.readpage		= zonefs_readpage,
+	.read_folio		= zonefs_read_folio,
 	.readahead		= zonefs_readahead,
 	.writepage		= zonefs_writepage,
 	.writepages		= zonefs_writepages,
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index b76f0dd149fb..5b2aa45ddda3 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -225,7 +225,7 @@ static inline const struct iomap *iomap_iter_srcmap(const struct iomap_iter *i)
 
 ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from,
 		const struct iomap_ops *ops);
-int iomap_readpage(struct page *page, const struct iomap_ops *ops);
+int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops);
 void iomap_readahead(struct readahead_control *, const struct iomap_ops *ops);
 bool iomap_is_partially_uptodate(struct folio *, size_t from, size_t count);
 int iomap_releasepage(struct page *page, gfp_t gfp_mask);
-- 
2.34.1


  parent reply	other threads:[~2022-04-29 17:26 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-29 17:24 [PATCH 00/69] Filesystem/page cache patches for 5.19 Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 01/69] scsicam: Fix use of page cache Matthew Wilcox (Oracle)
2022-05-03 14:35   ` Christoph Hellwig
2022-05-03 21:12     ` Matthew Wilcox
2022-04-29 17:24 ` [PATCH 02/69] ext4: Use page_symlink() instead of __page_symlink() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 03/69] namei: Merge page_symlink() and __page_symlink() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 04/69] namei: Convert page_symlink() to use memalloc_nofs_save() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 05/69] f2fs: Convert f2fs_grab_cache_page() to use scoped memory APIs Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 06/69] ext4: Allow GFP_FS allocations in ext4_da_convert_inline_data_to_extent() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 07/69] ext4: Use scoped memory API in mext_page_double_lock() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 08/69] ext4: Use scoped memory APIs in ext4_da_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 09/69] ext4: Use scoped memory APIs in ext4_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 10/69] fs: Remove AOP_FLAG_NOFS Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 11/69] fs: Remove aop_flags parameter from netfs_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:24 ` [PATCH 12/69] fs: Remove aop flags parameter from block_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 13/69] fs: Remove aop flags parameter from cont_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 14/69] fs: Remove aop flags parameter from grab_cache_page_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 15/69] fs: Remove aop flags parameter from nobh_write_begin() Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 16/69] fs: Remove flags parameter from aops->write_begin Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 17/69] buffer: Call aops write_begin() and write_end() directly Matthew Wilcox (Oracle)
2022-05-03 14:36   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 18/69] namei: " Matthew Wilcox (Oracle)
2022-05-03 14:36   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 19/69] ntfs3: Call ntfs_write_begin() and ntfs_write_end() directly Matthew Wilcox (Oracle)
2022-05-03  6:15   ` Namjae Jeon
2022-05-03 14:36   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 20/69] hfs: Call hfs_write_begin() and generic_write_end() directly Matthew Wilcox (Oracle)
2022-05-03 14:37   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 21/69] hfsplus: Call hfsplus_write_begin() " Matthew Wilcox (Oracle)
2022-05-03 14:37   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 22/69] ext4: Call aops write_begin() and write_end() directly Matthew Wilcox (Oracle)
2022-05-03 14:37   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 23/69] f2fs: " Matthew Wilcox (Oracle)
2022-05-03 14:37   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 24/69] i915: " Matthew Wilcox (Oracle)
2022-05-03 14:38   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 25/69] fs: Remove pagecache_write_begin() and pagecache_write_end() Matthew Wilcox (Oracle)
2022-05-03 14:38   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 26/69] filemap: Remove obsolete comment in lock_page Matthew Wilcox (Oracle)
2022-05-03 14:38   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 27/69] filemap: Update the folio_lock documentation Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 28/69] filemap: Update the folio_mark_dirty documentation Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 29/69] readahead: Use a folio in read_pages() Matthew Wilcox (Oracle)
2022-05-03 14:38   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 30/69] fs: Convert is_dirty_writeback() to take a folio Matthew Wilcox (Oracle)
2022-05-03 14:39   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 31/69] mm/readahead: Convert page_cache_async_readahead " Matthew Wilcox (Oracle)
2022-05-03 14:39   ` Christoph Hellwig
2022-04-29 17:25 ` [PATCH 32/69] buffer: Rewrite nobh_truncate_page() to use folios Matthew Wilcox (Oracle)
2022-05-03 14:41   ` Christoph Hellwig
2022-05-08 18:37     ` Matthew Wilcox
2022-04-29 17:25 ` [PATCH 33/69] fs: Introduce aops->read_folio Matthew Wilcox (Oracle)
2022-05-03 14:42   ` Christoph Hellwig
2022-05-06 20:22   ` Kees Cook
2022-04-29 17:25 ` [PATCH 34/69] fs: read_folio documentation Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 35/69] fs: Convert netfs_readpage to netfs_read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` Matthew Wilcox (Oracle) [this message]
2022-04-29 17:25 ` [PATCH 37/69] fs: Convert block_read_full_page() to block_read_full_folio() Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 38/69] fs: Convert mpage_readpage to mpage_read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 39/69] fs: Convert simple_readpage to simple_read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 40/69] affs: Convert affs to read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 41/69] afs: Convert afs_symlink_readpage to afs_symlink_read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 42/69] befs: Convert befs to read_folio Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 43/69] btrfs: Convert btrfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 44/69] cifs: Convert cifs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 45/69] coda: Convert coda " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 46/69] cramfs: Convert cramfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 47/69] ecryptfs: Convert ecryptfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 48/69] efs: Convert efs symlinks " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 49/69] erofs: Convert erofs zdata " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 50/69] ext4: Convert ext4 " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 51/69] f2fs: Convert f2fs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 52/69] freevxfs: Convert vxfs_immed " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 53/69] fuse: Convert fuse " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 54/69] hostfs: Convert hostfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 55/69] hpfs: Convert symlinks " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 56/69] isofs: Convert symlinks and zisofs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 57/69] jffs2: Convert jffs2 " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 58/69] jfs: Convert metadata pages " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 59/69] nfs: Convert nfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 60/69] ntfs: Convert ntfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 61/69] ocfs2: Convert ocfs2 " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 62/69] orangefs: Convert orangefs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 63/69] romfs: Convert romfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 64/69] squashfs: Convert squashfs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 65/69] ubifs: Convert ubifs " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 66/69] udf: Convert adinicb and symlinks " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 67/69] vboxsf: Convert vboxsf " Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 68/69] mm: Convert swap_readpage to call read_folio instead of readpage Matthew Wilcox (Oracle)
2022-04-29 17:25 ` [PATCH 69/69] mm,fs: Remove stray references to ->readpage Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220429172556.3011843-37-willy@infradead.org \
    --to=willy@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.