Skip to content

Commit 413e8f0

Browse files
Matthew Wilcox (Oracle)Miklos Szeredi
authored andcommitted
fuse: Convert fuse_readpages_end() to use folio_end_read()
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(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
1 parent 96d88f6 commit 413e8f0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

fs/fuse/file.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -935,14 +935,10 @@ static void fuse_readpages_end(struct fuse_mount *fm, struct fuse_args *args,
935935
}
936936

937937
for (i = 0; i < ap->num_pages; i++) {
938-
struct page *page = ap->pages[i];
938+
struct folio *folio = page_folio(ap->pages[i]);
939939

940-
if (!err)
941-
SetPageUptodate(page);
942-
else
943-
SetPageError(page);
944-
unlock_page(page);
945-
put_page(page);
940+
folio_end_read(folio, !err);
941+
folio_put(folio);
946942
}
947943
if (ia->ff)
948944
fuse_file_put(ia->ff, false);

0 commit comments

Comments
 (0)