aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/symlink.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-05-01 12:06:35 -0400
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2019-05-09 16:26:57 -0400
commita46126ccc77e764429d63bf958d117f607f4b6c6 (patch)
tree00cd9f45890ffa99dacfe50924142db80ea63485 /fs/nfs/symlink.c
parentNFSv4: don't mark all open state for recovery when handling recallable state revoked flag (diff)
downloadlinux-dev-a46126ccc77e764429d63bf958d117f607f4b6c6.tar.xz
linux-dev-a46126ccc77e764429d63bf958d117f607f4b6c6.zip
nfs: pass the correct prototype to read_cache_page
Fix the callbacks NFS passes to read_cache_page to actually have the proper type expected. Casting around function pointers can easily hide typing bugs, and defeats control flow protection. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to '')
-rw-r--r--fs/nfs/symlink.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/nfs/symlink.c b/fs/nfs/symlink.c
index 06eb44b47885..25ba299fdac2 100644
--- a/fs/nfs/symlink.c
+++ b/fs/nfs/symlink.c
@@ -26,8 +26,9 @@
* and straight-forward than readdir caching.
*/
-static int nfs_symlink_filler(struct inode *inode, struct page *page)
+static int nfs_symlink_filler(void *data, struct page *page)
{
+ struct inode *inode = data;
int error;
error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE);
@@ -65,8 +66,8 @@ static const char *nfs_get_link(struct dentry *dentry,
err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
if (err)
return err;
- page = read_cache_page(&inode->i_data, 0,
- (filler_t *)nfs_symlink_filler, inode);
+ page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler,
+ inode);
if (IS_ERR(page))
return ERR_CAST(page);
}