Skip to content

Commit cc8e87f

Browse files
Matthew Wilcox (Oracle)brauner
authored andcommitted
nfs: Use a folio in nfs_get_link()
Mirror the changes to __page_get_link() by retrieving a folio from the page cache instead of a page. Removes two hidden calls to compound_head(). Signed-off-by: "Matthew Wilcox (Oracle)" <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 5f152cc commit cc8e87f

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

fs/nfs/symlink.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,31 +40,31 @@ static const char *nfs_get_link(struct dentry *dentry,
4040
struct inode *inode,
4141
struct delayed_call *done)
4242
{
43-
struct page *page;
43+
struct folio *folio;
4444
void *err;
4545

4646
if (!dentry) {
4747
err = ERR_PTR(nfs_revalidate_mapping_rcu(inode));
4848
if (err)
4949
return err;
50-
page = find_get_page(inode->i_mapping, 0);
51-
if (!page)
50+
folio = filemap_get_folio(inode->i_mapping, 0);
51+
if (IS_ERR(folio))
5252
return ERR_PTR(-ECHILD);
53-
if (!PageUptodate(page)) {
54-
put_page(page);
53+
if (!folio_test_uptodate(folio)) {
54+
folio_put(folio);
5555
return ERR_PTR(-ECHILD);
5656
}
5757
} else {
5858
err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
5959
if (err)
6060
return err;
61-
page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler,
61+
folio = read_cache_folio(&inode->i_data, 0, nfs_symlink_filler,
6262
NULL);
63-
if (IS_ERR(page))
64-
return ERR_CAST(page);
63+
if (IS_ERR(folio))
64+
return ERR_CAST(folio);
6565
}
66-
set_delayed_call(done, page_put_link, page);
67-
return page_address(page);
66+
set_delayed_call(done, page_put_link, &folio->page);
67+
return folio_address(folio);
6868
}
6969

7070
/*

0 commit comments

Comments
 (0)