From: Pankaj Raghav <p.raghav@samsung.com>
To: hubcap@omnibond.com, senozhatsky@chromium.org,
martin@omnibond.com, willy@infradead.org, minchan@kernel.org,
viro@zeniv.linux.org.uk, brauner@kernel.org, axboe@kernel.dk,
akpm@linux-foundation.org
Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
gost.dev@samsung.com, mcgrof@kernel.org,
devel@lists.orangefs.org, Pankaj Raghav <p.raghav@samsung.com>
Subject: [RFC PATCH 1/3] filemap: convert page_endio to folio_endio
Date: Wed, 15 Mar 2023 13:32:31 +0100 [thread overview]
Message-ID: <20230315123233.121593-2-p.raghav@samsung.com> (raw)
In-Reply-To: <20230315123233.121593-1-p.raghav@samsung.com>
page_endio() already works on folios by converting a page in to a folio as
the first step. Convert page_endio to folio_endio by taking a folio as the
first parameter.
Instead of doing a page to folio conversion in the page_endio()
function, the consumers of this API do this conversion and call the
folio_endio() function in this patch.
The following patches will convert the consumers of this API to use native
folio functions to pass to folio_endio().
Signed-off-by: Pankaj Raghav <p.raghav@samsung.com>
---
drivers/block/zram/zram_drv.c | 2 +-
fs/mpage.c | 2 +-
fs/orangefs/inode.c | 2 +-
include/linux/pagemap.h | 2 +-
mm/filemap.c | 8 +++-----
5 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index aa490da3cef2..f441251c9138 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -610,7 +610,7 @@ static void zram_page_end_io(struct bio *bio)
{
struct page *page = bio_first_page_all(bio);
- page_endio(page, op_is_write(bio_op(bio)),
+ folio_endio(page_folio(page), op_is_write(bio_op(bio)),
blk_status_to_errno(bio->bi_status));
bio_put(bio);
}
diff --git a/fs/mpage.c b/fs/mpage.c
index 22b9de5ddd68..40e86e839e77 100644
--- a/fs/mpage.c
+++ b/fs/mpage.c
@@ -50,7 +50,7 @@ static void mpage_end_io(struct bio *bio)
bio_for_each_segment_all(bv, bio, iter_all) {
struct page *page = bv->bv_page;
- page_endio(page, bio_op(bio),
+ folio_endio(page_folio(page), bio_op(bio),
blk_status_to_errno(bio->bi_status));
}
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index aefdf1d3be7c..b12d099510ea 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -276,7 +276,7 @@ static void orangefs_readahead(struct readahead_control *rac)
/* clean up. */
while ((page = readahead_page(rac))) {
- page_endio(page, false, ret);
+ folio_endio(page_folio(page), false, ret);
put_page(page);
}
}
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index fdcd595d2294..80eab64b834f 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -1076,7 +1076,7 @@ int filemap_migrate_folio(struct address_space *mapping, struct folio *dst,
#else
#define filemap_migrate_folio NULL
#endif
-void page_endio(struct page *page, bool is_write, int err);
+void folio_endio(struct folio *folio, bool is_write, int err);
void folio_end_private_2(struct folio *folio);
void folio_wait_private_2(struct folio *folio);
diff --git a/mm/filemap.c b/mm/filemap.c
index a34abfe8c654..a89940f74974 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1626,13 +1626,11 @@ void folio_end_writeback(struct folio *folio)
EXPORT_SYMBOL(folio_end_writeback);
/*
- * After completing I/O on a page, call this routine to update the page
+ * After completing I/O on a folio, call this routine to update the folio
* flags appropriately
*/
-void page_endio(struct page *page, bool is_write, int err)
+void folio_endio(struct folio *folio, bool is_write, int err)
{
- struct folio *folio = page_folio(page);
-
if (!is_write) {
if (!err) {
folio_mark_uptodate(folio);
@@ -1653,7 +1651,7 @@ void page_endio(struct page *page, bool is_write, int err)
folio_end_writeback(folio);
}
}
-EXPORT_SYMBOL_GPL(page_endio);
+EXPORT_SYMBOL_GPL(folio_endio);
/**
* __folio_lock - Get a lock on the folio, assuming we need to sleep to get it.
--
2.34.1
next prev parent reply other threads:[~2023-03-15 12:34 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230315123234eucas1p179bf8c0583a71d91bef7e909d7ec6504@eucas1p1.samsung.com>
2023-03-15 12:32 ` [RFC PATCH 0/3] convert page_endio to folio_endio Pankaj Raghav
[not found] ` <CGME20230315123234eucas1p2503d83ad0180cecde02e924d7b143535@eucas1p2.samsung.com>
2023-03-15 12:32 ` Pankaj Raghav [this message]
2023-03-15 14:46 ` [RFC PATCH 1/3] filemap: " Luis Chamberlain
2023-03-15 14:51 ` Hannes Reinecke
2023-03-15 14:56 ` Christoph Hellwig
2023-03-16 10:04 ` Pankaj Raghav
2023-03-16 15:24 ` Christoph Hellwig
2023-03-17 15:31 ` Matthew Wilcox
2023-03-17 16:14 ` Pankaj Raghav
2023-03-21 13:51 ` Pankaj Raghav
[not found] ` <CGME20230315123235eucas1p1bd62cb2aab435727880769f2e57624fd@eucas1p1.samsung.com>
2023-03-15 12:32 ` [RFC PATCH 2/3] mpage: use bio_for_each_folio_all in mpage_end_io() Pankaj Raghav
2023-03-15 14:47 ` Luis Chamberlain
2023-03-15 14:52 ` Hannes Reinecke
2023-03-15 16:08 ` Matthew Wilcox
2023-03-16 10:07 ` Pankaj Raghav
[not found] ` <CGME20230315123236eucas1p1116e1b8537191310bd03dd267b9f8eb8@eucas1p1.samsung.com>
2023-03-15 12:32 ` [RFC PATCH 3/3] orangefs: use folio in orangefs_readahead() Pankaj Raghav
2023-03-15 14:48 ` Luis Chamberlain
2023-03-15 16:05 ` Matthew Wilcox
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=20230315123233.121593-2-p.raghav@samsung.com \
--to=p.raghav@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=brauner@kernel.org \
--cc=devel@lists.orangefs.org \
--cc=gost.dev@samsung.com \
--cc=hubcap@omnibond.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=martin@omnibond.com \
--cc=mcgrof@kernel.org \
--cc=minchan@kernel.org \
--cc=senozhatsky@chromium.org \
--cc=viro@zeniv.linux.org.uk \
--cc=willy@infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).