* [PATCH] ubifs: stop using write_cache_pages
@ 2025-07-11 8:11 Christoph Hellwig
2025-07-11 9:09 ` Zhihao Cheng
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2025-07-11 8:11 UTC (permalink / raw)
To: richard; +Cc: chengzhihao1, linux-mtd
Stop using the obsolete write_cache_pages and use writeback_iter directly.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/ubifs/file.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
index bf311c38d9a8..d52181f533ac 100644
--- a/fs/ubifs/file.c
+++ b/fs/ubifs/file.c
@@ -977,8 +977,7 @@ static int do_writepage(struct folio *folio, size_t len)
* on the page lock and it would not write the truncated inode node to the
* journal before we have finished.
*/
-static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,
- void *data)
+static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc)
{
struct inode *inode = folio->mapping->host;
struct ubifs_info *c = inode->i_sb->s_fs_info;
@@ -1050,7 +1049,12 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,
static int ubifs_writepages(struct address_space *mapping,
struct writeback_control *wbc)
{
- return write_cache_pages(mapping, wbc, ubifs_writepage, NULL);
+ struct folio *folio = NULL;
+ int error;
+
+ while ((folio = writeback_iter(mapping, wbc, folio, &error)))
+ error = ubifs_writepage(folio, wbc);
+ return error;
}
/**
--
2.47.2
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ubifs: stop using write_cache_pages
2025-07-11 8:11 [PATCH] ubifs: stop using write_cache_pages Christoph Hellwig
@ 2025-07-11 9:09 ` Zhihao Cheng
2025-07-23 5:34 ` Christoph Hellwig
0 siblings, 1 reply; 4+ messages in thread
From: Zhihao Cheng @ 2025-07-11 9:09 UTC (permalink / raw)
To: Christoph Hellwig, richard; +Cc: linux-mtd
在 2025/7/11 16:11, Christoph Hellwig 写道:
> Stop using the obsolete write_cache_pages and use writeback_iter directly.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> fs/ubifs/file.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
> index bf311c38d9a8..d52181f533ac 100644
> --- a/fs/ubifs/file.c
> +++ b/fs/ubifs/file.c
> @@ -977,8 +977,7 @@ static int do_writepage(struct folio *folio, size_t len)
> * on the page lock and it would not write the truncated inode node to the
> * journal before we have finished.
> */
> -static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,
> - void *data)
> +static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc)
> {
> struct inode *inode = folio->mapping->host;
> struct ubifs_info *c = inode->i_sb->s_fs_info;
> @@ -1050,7 +1049,12 @@ static int ubifs_writepage(struct folio *folio, struct writeback_control *wbc,
> static int ubifs_writepages(struct address_space *mapping,
> struct writeback_control *wbc)
> {
> - return write_cache_pages(mapping, wbc, ubifs_writepage, NULL);
> + struct folio *folio = NULL;
> + int error;
> +
> + while ((folio = writeback_iter(mapping, wbc, folio, &error)))
> + error = ubifs_writepage(folio, wbc);
> + return error;
> }
>
> /**
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ubifs: stop using write_cache_pages
2025-07-11 9:09 ` Zhihao Cheng
@ 2025-07-23 5:34 ` Christoph Hellwig
2025-07-23 6:36 ` Richard Weinberger
0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2025-07-23 5:34 UTC (permalink / raw)
To: Zhihao Cheng; +Cc: Christoph Hellwig, richard, linux-mtd
Can you pick this for 6.17?
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ubifs: stop using write_cache_pages
2025-07-23 5:34 ` Christoph Hellwig
@ 2025-07-23 6:36 ` Richard Weinberger
0 siblings, 0 replies; 4+ messages in thread
From: Richard Weinberger @ 2025-07-23 6:36 UTC (permalink / raw)
To: hch; +Cc: chengzhihao1, linux-mtd
----- Ursprüngliche Mail -----
> Von: "hch" <hch@lst.de>
> An: "chengzhihao1" <chengzhihao1@huawei.com>
> CC: "hch" <hch@lst.de>, "richard" <richard@nod.at>, "linux-mtd" <linux-mtd@lists.infradead.org>
> Gesendet: Mittwoch, 23. Juli 2025 07:34:03
> Betreff: Re: [PATCH] ubifs: stop using write_cache_pages
> Can you pick this for 6.17?
Will do.
Thanks,
//richard
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-07-23 6:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-11 8:11 [PATCH] ubifs: stop using write_cache_pages Christoph Hellwig
2025-07-11 9:09 ` Zhihao Cheng
2025-07-23 5:34 ` Christoph Hellwig
2025-07-23 6:36 ` Richard Weinberger
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).