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>
This commit is contained in:
parent
96d88f65ad
commit
413e8f014c
1 changed files with 3 additions and 7 deletions
|
@ -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++) {
|
for (i = 0; i < ap->num_pages; i++) {
|
||||||
struct page *page = ap->pages[i];
|
struct folio *folio = page_folio(ap->pages[i]);
|
||||||
|
|
||||||
if (!err)
|
folio_end_read(folio, !err);
|
||||||
SetPageUptodate(page);
|
folio_put(folio);
|
||||||
else
|
|
||||||
SetPageError(page);
|
|
||||||
unlock_page(page);
|
|
||||||
put_page(page);
|
|
||||||
}
|
}
|
||||||
if (ia->ff)
|
if (ia->ff)
|
||||||
fuse_file_put(ia->ff, false);
|
fuse_file_put(ia->ff, false);
|
||||||
|
|
Loading…
Add table
Reference in a new issue