symlink.c (498495dba268b20e8eadd7fe93c140c68b6cc9d2) symlink.c (a46126ccc77e764429d63bf958d117f607f4b6c6)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/nfs/symlink.c
4 *
5 * Copyright (C) 1992 Rick Sladkey
6 *
7 * Optimization changes Copyright (C) 1994 Florian La Roche
8 *

--- 12 unchanged lines hidden (view full) ---

21#include <linux/stat.h>
22#include <linux/mm.h>
23#include <linux/string.h>
24
25/* Symlink caching in the page cache is even more simplistic
26 * and straight-forward than readdir caching.
27 */
28
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * linux/fs/nfs/symlink.c
4 *
5 * Copyright (C) 1992 Rick Sladkey
6 *
7 * Optimization changes Copyright (C) 1994 Florian La Roche
8 *

--- 12 unchanged lines hidden (view full) ---

21#include <linux/stat.h>
22#include <linux/mm.h>
23#include <linux/string.h>
24
25/* Symlink caching in the page cache is even more simplistic
26 * and straight-forward than readdir caching.
27 */
28
29static int nfs_symlink_filler(struct inode *inode, struct page *page)
29static int nfs_symlink_filler(void *data, struct page *page)
30{
30{
31 struct inode *inode = data;
31 int error;
32
33 error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE);
34 if (error < 0)
35 goto error;
36 SetPageUptodate(page);
37 unlock_page(page);
38 return 0;

--- 21 unchanged lines hidden (view full) ---

60 if (!PageUptodate(page)) {
61 put_page(page);
62 return ERR_PTR(-ECHILD);
63 }
64 } else {
65 err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
66 if (err)
67 return err;
32 int error;
33
34 error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE);
35 if (error < 0)
36 goto error;
37 SetPageUptodate(page);
38 unlock_page(page);
39 return 0;

--- 21 unchanged lines hidden (view full) ---

61 if (!PageUptodate(page)) {
62 put_page(page);
63 return ERR_PTR(-ECHILD);
64 }
65 } else {
66 err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
67 if (err)
68 return err;
68 page = read_cache_page(&inode->i_data, 0,
69 (filler_t *)nfs_symlink_filler, inode);
69 page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler,
70 inode);
70 if (IS_ERR(page))
71 return ERR_CAST(page);
72 }
73 set_delayed_call(done, page_put_link, page);
74 return page_address(page);
75}
76
77/*
78 * symlinks can't do much...
79 */
80const struct inode_operations nfs_symlink_inode_operations = {
81 .get_link = nfs_get_link,
82 .getattr = nfs_getattr,
83 .setattr = nfs_setattr,
84};
71 if (IS_ERR(page))
72 return ERR_CAST(page);
73 }
74 set_delayed_call(done, page_put_link, page);
75 return page_address(page);
76}
77
78/*
79 * symlinks can't do much...
80 */
81const struct inode_operations nfs_symlink_inode_operations = {
82 .get_link = nfs_get_link,
83 .getattr = nfs_getattr,
84 .setattr = nfs_setattr,
85};