nfs: merge nfs_pgio_data into _header

struct nfs_pgio_data only exists as a member of nfs_pgio_header, but is
passed around everywhere, because there used to be multiple _data structs
per _header. Many of these functions then use the _data to find a pointer
to the _header.  This patch cleans this up by merging the nfs_pgio_data
structure into nfs_pgio_header and passing nfs_pgio_header around instead.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Weston Andros Adamson <dros@primarydata.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
This commit is contained in:
Weston Andros Adamson 2014-06-09 11:48:35 -04:00 committed by Trond Myklebust
parent 823b0c9d98
commit d45f60c678
19 changed files with 460 additions and 482 deletions

View file

@ -795,41 +795,44 @@ nfs3_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
return status;
}
static int nfs3_read_done(struct rpc_task *task, struct nfs_pgio_data *data)
static int nfs3_read_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{
struct inode *inode = data->header->inode;
struct inode *inode = hdr->inode;
if (nfs3_async_handle_jukebox(task, inode))
return -EAGAIN;
nfs_invalidate_atime(inode);
nfs_refresh_inode(inode, &data->fattr);
nfs_refresh_inode(inode, &hdr->fattr);
return 0;
}
static void nfs3_proc_read_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
static void nfs3_proc_read_setup(struct nfs_pgio_header *hdr,
struct rpc_message *msg)
{
msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ];
}
static int nfs3_proc_pgio_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
static int nfs3_proc_pgio_rpc_prepare(struct rpc_task *task,
struct nfs_pgio_header *hdr)
{
rpc_call_start(task);
return 0;
}
static int nfs3_write_done(struct rpc_task *task, struct nfs_pgio_data *data)
static int nfs3_write_done(struct rpc_task *task, struct nfs_pgio_header *hdr)
{
struct inode *inode = data->header->inode;
struct inode *inode = hdr->inode;
if (nfs3_async_handle_jukebox(task, inode))
return -EAGAIN;
if (task->tk_status >= 0)
nfs_post_op_update_inode_force_wcc(inode, data->res.fattr);
nfs_post_op_update_inode_force_wcc(inode, hdr->res.fattr);
return 0;
}
static void nfs3_proc_write_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
static void nfs3_proc_write_setup(struct nfs_pgio_header *hdr,
struct rpc_message *msg)
{
msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE];
}