Commit a46126cc authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Anna Schumaker

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent 8ca017c8
...@@ -714,8 +714,9 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, ...@@ -714,8 +714,9 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page,
* We only need to convert from xdr once so future lookups are much simpler * We only need to convert from xdr once so future lookups are much simpler
*/ */
static static
int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) int nfs_readdir_filler(void *data, struct page* page)
{ {
nfs_readdir_descriptor_t *desc = data;
struct inode *inode = file_inode(desc->file); struct inode *inode = file_inode(desc->file);
int ret; int ret;
...@@ -762,8 +763,8 @@ void cache_page_release(nfs_readdir_descriptor_t *desc) ...@@ -762,8 +763,8 @@ void cache_page_release(nfs_readdir_descriptor_t *desc)
static static
struct page *get_cache_page(nfs_readdir_descriptor_t *desc) struct page *get_cache_page(nfs_readdir_descriptor_t *desc)
{ {
return read_cache_page(desc->file->f_mapping, return read_cache_page(desc->file->f_mapping, desc->page_index,
desc->page_index, (filler_t *)nfs_readdir_filler, desc); nfs_readdir_filler, desc);
} }
/* /*
......
...@@ -26,8 +26,9 @@ ...@@ -26,8 +26,9 @@
* and straight-forward than readdir caching. * 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; int error;
error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE); error = NFS_PROTO(inode)->readlink(inode, page, 0, PAGE_SIZE);
...@@ -65,8 +66,8 @@ static const char *nfs_get_link(struct dentry *dentry, ...@@ -65,8 +66,8 @@ static const char *nfs_get_link(struct dentry *dentry,
err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping)); err = ERR_PTR(nfs_revalidate_mapping(inode, inode->i_mapping));
if (err) if (err)
return err; return err;
page = read_cache_page(&inode->i_data, 0, page = read_cache_page(&inode->i_data, 0, nfs_symlink_filler,
(filler_t *)nfs_symlink_filler, inode); inode);
if (IS_ERR(page)) if (IS_ERR(page))
return ERR_CAST(page); return ERR_CAST(page);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment