diff mbox series

[11/30] fuse: Convert fuse_readpages_end() to use folio_end_read()

Message ID 20240420025029.2166544-12-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Remove PG_error flag | expand

Commit Message

Matthew Wilcox April 20, 2024, 2:50 a.m. UTC
Nobody checks the error flag on fuse folios, so stop setting it.
Optimise the (optional) setting of the uptodate flag and clearing
of the lock flag by using folio_end_read().

Cc: Miklos Szeredi <miklos@szeredi.hu>
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 fs/fuse/file.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Comments

Miklos Szeredi April 22, 2024, 3:20 p.m. UTC | #1
On Sat, 20 Apr 2024 at 04:50, Matthew Wilcox (Oracle)
<willy@infradead.org> wrote:
>
> Nobody checks the error flag on fuse folios, so stop setting it.
> Optimise the (optional) setting of the uptodate flag and clearing
> of the lock flag by using folio_end_read().
>
> Cc: Miklos Szeredi <miklos@szeredi.hu>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Applied, thanks.

Miklos
diff mbox series

Patch

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index b57ce4157640..f39456c65ed7 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -935,14 +935,10 @@  static void fuse_readpages_end(struct fuse_mount *fm, struct fuse_args *args,
 	}
 
 	for (i = 0; i < ap->num_pages; i++) {
-		struct page *page = ap->pages[i];
+		struct folio *folio = page_folio(ap->pages[i]);
 
-		if (!err)
-			SetPageUptodate(page);
-		else
-			SetPageError(page);
-		unlock_page(page);
-		put_page(page);
+		folio_end_read(folio, !err);
+		folio_put(folio);
 	}
 	if (ia->ff)
 		fuse_file_put(ia->ff, false);