Commit 9c7e1b3d authored by Anna Schumaker's avatar Anna Schumaker Committed by Trond Myklebust

NFS: Create a common read and write data struct

At this point, the only difference between nfs_read_data and
nfs_write_data is the write verifier.
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
parent 9137bdf3
...@@ -210,7 +210,7 @@ static void bl_end_io_read(struct bio *bio, int err) ...@@ -210,7 +210,7 @@ static void bl_end_io_read(struct bio *bio, int err)
SetPageUptodate(bvec->bv_page); SetPageUptodate(bvec->bv_page);
if (err) { if (err) {
struct nfs_read_data *rdata = par->data; struct nfs_pgio_data *rdata = par->data;
struct nfs_pgio_header *header = rdata->header; struct nfs_pgio_header *header = rdata->header;
if (!header->pnfs_error) if (!header->pnfs_error)
...@@ -224,17 +224,17 @@ static void bl_end_io_read(struct bio *bio, int err) ...@@ -224,17 +224,17 @@ static void bl_end_io_read(struct bio *bio, int err)
static void bl_read_cleanup(struct work_struct *work) static void bl_read_cleanup(struct work_struct *work)
{ {
struct rpc_task *task; struct rpc_task *task;
struct nfs_read_data *rdata; struct nfs_pgio_data *rdata;
dprintk("%s enter\n", __func__); dprintk("%s enter\n", __func__);
task = container_of(work, struct rpc_task, u.tk_work); task = container_of(work, struct rpc_task, u.tk_work);
rdata = container_of(task, struct nfs_read_data, task); rdata = container_of(task, struct nfs_pgio_data, task);
pnfs_ld_read_done(rdata); pnfs_ld_read_done(rdata);
} }
static void static void
bl_end_par_io_read(void *data, int unused) bl_end_par_io_read(void *data, int unused)
{ {
struct nfs_read_data *rdata = data; struct nfs_pgio_data *rdata = data;
rdata->task.tk_status = rdata->header->pnfs_error; rdata->task.tk_status = rdata->header->pnfs_error;
INIT_WORK(&rdata->task.u.tk_work, bl_read_cleanup); INIT_WORK(&rdata->task.u.tk_work, bl_read_cleanup);
...@@ -242,7 +242,7 @@ bl_end_par_io_read(void *data, int unused) ...@@ -242,7 +242,7 @@ bl_end_par_io_read(void *data, int unused)
} }
static enum pnfs_try_status static enum pnfs_try_status
bl_read_pagelist(struct nfs_read_data *rdata) bl_read_pagelist(struct nfs_pgio_data *rdata)
{ {
struct nfs_pgio_header *header = rdata->header; struct nfs_pgio_header *header = rdata->header;
int i, hole; int i, hole;
...@@ -390,7 +390,7 @@ static void bl_end_io_write_zero(struct bio *bio, int err) ...@@ -390,7 +390,7 @@ static void bl_end_io_write_zero(struct bio *bio, int err)
} }
if (unlikely(err)) { if (unlikely(err)) {
struct nfs_write_data *data = par->data; struct nfs_pgio_data *data = par->data;
struct nfs_pgio_header *header = data->header; struct nfs_pgio_header *header = data->header;
if (!header->pnfs_error) if (!header->pnfs_error)
...@@ -405,7 +405,7 @@ static void bl_end_io_write(struct bio *bio, int err) ...@@ -405,7 +405,7 @@ static void bl_end_io_write(struct bio *bio, int err)
{ {
struct parallel_io *par = bio->bi_private; struct parallel_io *par = bio->bi_private;
const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); const int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
struct nfs_write_data *data = par->data; struct nfs_pgio_data *data = par->data;
struct nfs_pgio_header *header = data->header; struct nfs_pgio_header *header = data->header;
if (!uptodate) { if (!uptodate) {
...@@ -423,10 +423,10 @@ static void bl_end_io_write(struct bio *bio, int err) ...@@ -423,10 +423,10 @@ static void bl_end_io_write(struct bio *bio, int err)
static void bl_write_cleanup(struct work_struct *work) static void bl_write_cleanup(struct work_struct *work)
{ {
struct rpc_task *task; struct rpc_task *task;
struct nfs_write_data *wdata; struct nfs_pgio_data *wdata;
dprintk("%s enter\n", __func__); dprintk("%s enter\n", __func__);
task = container_of(work, struct rpc_task, u.tk_work); task = container_of(work, struct rpc_task, u.tk_work);
wdata = container_of(task, struct nfs_write_data, task); wdata = container_of(task, struct nfs_pgio_data, task);
if (likely(!wdata->header->pnfs_error)) { if (likely(!wdata->header->pnfs_error)) {
/* Marks for LAYOUTCOMMIT */ /* Marks for LAYOUTCOMMIT */
mark_extents_written(BLK_LSEG2EXT(wdata->header->lseg), mark_extents_written(BLK_LSEG2EXT(wdata->header->lseg),
...@@ -438,7 +438,7 @@ static void bl_write_cleanup(struct work_struct *work) ...@@ -438,7 +438,7 @@ static void bl_write_cleanup(struct work_struct *work)
/* Called when last of bios associated with a bl_write_pagelist call finishes */ /* Called when last of bios associated with a bl_write_pagelist call finishes */
static void bl_end_par_io_write(void *data, int num_se) static void bl_end_par_io_write(void *data, int num_se)
{ {
struct nfs_write_data *wdata = data; struct nfs_pgio_data *wdata = data;
if (unlikely(wdata->header->pnfs_error)) { if (unlikely(wdata->header->pnfs_error)) {
bl_free_short_extents(&BLK_LSEG2EXT(wdata->header->lseg)->bl_inval, bl_free_short_extents(&BLK_LSEG2EXT(wdata->header->lseg)->bl_inval,
...@@ -673,7 +673,7 @@ bl_find_get_zeroing_page(struct inode *inode, pgoff_t index, ...@@ -673,7 +673,7 @@ bl_find_get_zeroing_page(struct inode *inode, pgoff_t index,
} }
static enum pnfs_try_status static enum pnfs_try_status
bl_write_pagelist(struct nfs_write_data *wdata, int sync) bl_write_pagelist(struct nfs_pgio_data *wdata, int sync)
{ {
struct nfs_pgio_header *header = wdata->header; struct nfs_pgio_header *header = wdata->header;
int i, ret, npg_zero, pg_index, last = 0; int i, ret, npg_zero, pg_index, last = 0;
......
...@@ -401,13 +401,13 @@ extern void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio, ...@@ -401,13 +401,13 @@ extern void nfs_pageio_init_read(struct nfs_pageio_descriptor *pgio,
struct inode *inode, bool force_mds, struct inode *inode, bool force_mds,
const struct nfs_pgio_completion_ops *compl_ops); const struct nfs_pgio_completion_ops *compl_ops);
extern int nfs_initiate_read(struct rpc_clnt *clnt, extern int nfs_initiate_read(struct rpc_clnt *clnt,
struct nfs_read_data *data, struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops, int flags); const struct rpc_call_ops *call_ops, int flags);
extern void nfs_read_prepare(struct rpc_task *task, void *calldata); extern void nfs_read_prepare(struct rpc_task *task, void *calldata);
extern int nfs_generic_pagein(struct nfs_pageio_descriptor *desc, extern int nfs_generic_pagein(struct nfs_pageio_descriptor *desc,
struct nfs_pgio_header *hdr); struct nfs_pgio_header *hdr);
extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio); extern void nfs_pageio_reset_read_mds(struct nfs_pageio_descriptor *pgio);
extern void nfs_readdata_release(struct nfs_read_data *rdata); extern void nfs_readdata_release(struct nfs_pgio_data *rdata);
/* super.c */ /* super.c */
void nfs_clone_super(struct super_block *, struct nfs_mount_info *); void nfs_clone_super(struct super_block *, struct nfs_mount_info *);
...@@ -429,10 +429,10 @@ extern void nfs_writehdr_free(struct nfs_pgio_header *hdr); ...@@ -429,10 +429,10 @@ extern void nfs_writehdr_free(struct nfs_pgio_header *hdr);
extern int nfs_generic_flush(struct nfs_pageio_descriptor *desc, extern int nfs_generic_flush(struct nfs_pageio_descriptor *desc,
struct nfs_pgio_header *hdr); struct nfs_pgio_header *hdr);
extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio); extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio);
extern void nfs_writedata_release(struct nfs_write_data *wdata); extern void nfs_writedata_release(struct nfs_pgio_data *wdata);
extern void nfs_commit_free(struct nfs_commit_data *p); extern void nfs_commit_free(struct nfs_commit_data *p);
extern int nfs_initiate_write(struct rpc_clnt *clnt, extern int nfs_initiate_write(struct rpc_clnt *clnt,
struct nfs_write_data *data, struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
int how, int flags); int how, int flags);
extern void nfs_write_prepare(struct rpc_task *task, void *calldata); extern void nfs_write_prepare(struct rpc_task *task, void *calldata);
...@@ -492,7 +492,7 @@ static inline void nfs_inode_dio_wait(struct inode *inode) ...@@ -492,7 +492,7 @@ static inline void nfs_inode_dio_wait(struct inode *inode)
extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq); extern ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq);
/* nfs4proc.c */ /* nfs4proc.c */
extern void __nfs4_read_done_cb(struct nfs_read_data *); extern void __nfs4_read_done_cb(struct nfs_pgio_data *);
extern struct nfs_client *nfs4_init_client(struct nfs_client *clp, extern struct nfs_client *nfs4_init_client(struct nfs_client *clp,
const struct rpc_timeout *timeparms, const struct rpc_timeout *timeparms,
const char *ip_addr); const char *ip_addr);
......
...@@ -795,7 +795,7 @@ nfs3_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -795,7 +795,7 @@ nfs3_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
return status; return status;
} }
static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data) static int nfs3_read_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -807,18 +807,18 @@ static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data) ...@@ -807,18 +807,18 @@ static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data)
return 0; return 0;
} }
static void nfs3_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg) static void nfs3_proc_read_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ]; msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ];
} }
static int nfs3_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) static int nfs3_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
rpc_call_start(task); rpc_call_start(task);
return 0; return 0;
} }
static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) static int nfs3_write_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -829,12 +829,12 @@ static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) ...@@ -829,12 +829,12 @@ static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data)
return 0; return 0;
} }
static void nfs3_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) static void nfs3_proc_write_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE]; msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE];
} }
static int nfs3_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data) static int nfs3_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
rpc_call_start(task); rpc_call_start(task);
return 0; return 0;
......
...@@ -337,7 +337,7 @@ nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode, ...@@ -337,7 +337,7 @@ nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_mode,
*/ */
static inline void static inline void
nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp,
struct rpc_message *msg, struct nfs_write_data *wdata) struct rpc_message *msg, struct nfs_pgio_data *wdata)
{ {
if (_nfs4_state_protect(clp, NFS_SP4_MACH_CRED_WRITE, clntp, msg) && if (_nfs4_state_protect(clp, NFS_SP4_MACH_CRED_WRITE, clntp, msg) &&
!test_bit(NFS_SP4_MACH_CRED_COMMIT, &clp->cl_sp4_flags)) !test_bit(NFS_SP4_MACH_CRED_COMMIT, &clp->cl_sp4_flags))
...@@ -369,7 +369,7 @@ nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_flags, ...@@ -369,7 +369,7 @@ nfs4_state_protect(struct nfs_client *clp, unsigned long sp4_flags,
static inline void static inline void
nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp,
struct rpc_message *msg, struct nfs_write_data *wdata) struct rpc_message *msg, struct nfs_pgio_data *wdata)
{ {
} }
#endif /* CONFIG_NFS_V4_1 */ #endif /* CONFIG_NFS_V4_1 */
......
...@@ -84,7 +84,7 @@ filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset) ...@@ -84,7 +84,7 @@ filelayout_get_dserver_offset(struct pnfs_layout_segment *lseg, loff_t offset)
BUG(); BUG();
} }
static void filelayout_reset_write(struct nfs_write_data *data) static void filelayout_reset_write(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
struct rpc_task *task = &data->task; struct rpc_task *task = &data->task;
...@@ -105,7 +105,7 @@ static void filelayout_reset_write(struct nfs_write_data *data) ...@@ -105,7 +105,7 @@ static void filelayout_reset_write(struct nfs_write_data *data)
} }
} }
static void filelayout_reset_read(struct nfs_read_data *data) static void filelayout_reset_read(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
struct rpc_task *task = &data->task; struct rpc_task *task = &data->task;
...@@ -243,7 +243,7 @@ static int filelayout_async_handle_error(struct rpc_task *task, ...@@ -243,7 +243,7 @@ static int filelayout_async_handle_error(struct rpc_task *task,
/* NFS_PROTO call done callback routines */ /* NFS_PROTO call done callback routines */
static int filelayout_read_done_cb(struct rpc_task *task, static int filelayout_read_done_cb(struct rpc_task *task,
struct nfs_read_data *data) struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
int err; int err;
...@@ -270,7 +270,7 @@ static int filelayout_read_done_cb(struct rpc_task *task, ...@@ -270,7 +270,7 @@ static int filelayout_read_done_cb(struct rpc_task *task,
* rfc5661 is not clear about which credential should be used. * rfc5661 is not clear about which credential should be used.
*/ */
static void static void
filelayout_set_layoutcommit(struct nfs_write_data *wdata) filelayout_set_layoutcommit(struct nfs_pgio_data *wdata)
{ {
struct nfs_pgio_header *hdr = wdata->header; struct nfs_pgio_header *hdr = wdata->header;
...@@ -305,7 +305,7 @@ filelayout_reset_to_mds(struct pnfs_layout_segment *lseg) ...@@ -305,7 +305,7 @@ filelayout_reset_to_mds(struct pnfs_layout_segment *lseg)
*/ */
static void filelayout_read_prepare(struct rpc_task *task, void *data) static void filelayout_read_prepare(struct rpc_task *task, void *data)
{ {
struct nfs_read_data *rdata = data; struct nfs_pgio_data *rdata = data;
if (unlikely(test_bit(NFS_CONTEXT_BAD, &rdata->args.context->flags))) { if (unlikely(test_bit(NFS_CONTEXT_BAD, &rdata->args.context->flags))) {
rpc_exit(task, -EIO); rpc_exit(task, -EIO);
...@@ -317,7 +317,7 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data) ...@@ -317,7 +317,7 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data)
rpc_exit(task, 0); rpc_exit(task, 0);
return; return;
} }
rdata->read_done_cb = filelayout_read_done_cb; rdata->pgio_done_cb = filelayout_read_done_cb;
if (nfs41_setup_sequence(rdata->ds_clp->cl_session, if (nfs41_setup_sequence(rdata->ds_clp->cl_session,
&rdata->args.seq_args, &rdata->args.seq_args,
...@@ -331,7 +331,7 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data) ...@@ -331,7 +331,7 @@ static void filelayout_read_prepare(struct rpc_task *task, void *data)
static void filelayout_read_call_done(struct rpc_task *task, void *data) static void filelayout_read_call_done(struct rpc_task *task, void *data)
{ {
struct nfs_read_data *rdata = data; struct nfs_pgio_data *rdata = data;
dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status); dprintk("--> %s task->tk_status %d\n", __func__, task->tk_status);
...@@ -347,14 +347,14 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data) ...@@ -347,14 +347,14 @@ static void filelayout_read_call_done(struct rpc_task *task, void *data)
static void filelayout_read_count_stats(struct rpc_task *task, void *data) static void filelayout_read_count_stats(struct rpc_task *task, void *data)
{ {
struct nfs_read_data *rdata = data; struct nfs_pgio_data *rdata = data;
rpc_count_iostats(task, NFS_SERVER(rdata->header->inode)->client->cl_metrics); rpc_count_iostats(task, NFS_SERVER(rdata->header->inode)->client->cl_metrics);
} }
static void filelayout_read_release(void *data) static void filelayout_read_release(void *data)
{ {
struct nfs_read_data *rdata = data; struct nfs_pgio_data *rdata = data;
struct pnfs_layout_hdr *lo = rdata->header->lseg->pls_layout; struct pnfs_layout_hdr *lo = rdata->header->lseg->pls_layout;
filelayout_fenceme(lo->plh_inode, lo); filelayout_fenceme(lo->plh_inode, lo);
...@@ -363,7 +363,7 @@ static void filelayout_read_release(void *data) ...@@ -363,7 +363,7 @@ static void filelayout_read_release(void *data)
} }
static int filelayout_write_done_cb(struct rpc_task *task, static int filelayout_write_done_cb(struct rpc_task *task,
struct nfs_write_data *data) struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
int err; int err;
...@@ -419,7 +419,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task, ...@@ -419,7 +419,7 @@ static int filelayout_commit_done_cb(struct rpc_task *task,
static void filelayout_write_prepare(struct rpc_task *task, void *data) static void filelayout_write_prepare(struct rpc_task *task, void *data)
{ {
struct nfs_write_data *wdata = data; struct nfs_pgio_data *wdata = data;
if (unlikely(test_bit(NFS_CONTEXT_BAD, &wdata->args.context->flags))) { if (unlikely(test_bit(NFS_CONTEXT_BAD, &wdata->args.context->flags))) {
rpc_exit(task, -EIO); rpc_exit(task, -EIO);
...@@ -443,7 +443,7 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data) ...@@ -443,7 +443,7 @@ static void filelayout_write_prepare(struct rpc_task *task, void *data)
static void filelayout_write_call_done(struct rpc_task *task, void *data) static void filelayout_write_call_done(struct rpc_task *task, void *data)
{ {
struct nfs_write_data *wdata = data; struct nfs_pgio_data *wdata = data;
if (test_bit(NFS_IOHDR_REDO, &wdata->header->flags) && if (test_bit(NFS_IOHDR_REDO, &wdata->header->flags) &&
task->tk_status == 0) { task->tk_status == 0) {
...@@ -457,14 +457,14 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data) ...@@ -457,14 +457,14 @@ static void filelayout_write_call_done(struct rpc_task *task, void *data)
static void filelayout_write_count_stats(struct rpc_task *task, void *data) static void filelayout_write_count_stats(struct rpc_task *task, void *data)
{ {
struct nfs_write_data *wdata = data; struct nfs_pgio_data *wdata = data;
rpc_count_iostats(task, NFS_SERVER(wdata->header->inode)->client->cl_metrics); rpc_count_iostats(task, NFS_SERVER(wdata->header->inode)->client->cl_metrics);
} }
static void filelayout_write_release(void *data) static void filelayout_write_release(void *data)
{ {
struct nfs_write_data *wdata = data; struct nfs_pgio_data *wdata = data;
struct pnfs_layout_hdr *lo = wdata->header->lseg->pls_layout; struct pnfs_layout_hdr *lo = wdata->header->lseg->pls_layout;
filelayout_fenceme(lo->plh_inode, lo); filelayout_fenceme(lo->plh_inode, lo);
...@@ -529,7 +529,7 @@ static const struct rpc_call_ops filelayout_commit_call_ops = { ...@@ -529,7 +529,7 @@ static const struct rpc_call_ops filelayout_commit_call_ops = {
}; };
static enum pnfs_try_status static enum pnfs_try_status
filelayout_read_pagelist(struct nfs_read_data *data) filelayout_read_pagelist(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
struct pnfs_layout_segment *lseg = hdr->lseg; struct pnfs_layout_segment *lseg = hdr->lseg;
...@@ -575,7 +575,7 @@ filelayout_read_pagelist(struct nfs_read_data *data) ...@@ -575,7 +575,7 @@ filelayout_read_pagelist(struct nfs_read_data *data)
/* Perform async writes. */ /* Perform async writes. */
static enum pnfs_try_status static enum pnfs_try_status
filelayout_write_pagelist(struct nfs_write_data *data, int sync) filelayout_write_pagelist(struct nfs_pgio_data *data, int sync)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
struct pnfs_layout_segment *lseg = hdr->lseg; struct pnfs_layout_segment *lseg = hdr->lseg;
...@@ -600,7 +600,7 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync) ...@@ -600,7 +600,7 @@ filelayout_write_pagelist(struct nfs_write_data *data, int sync)
__func__, hdr->inode->i_ino, sync, (size_t) data->args.count, __func__, hdr->inode->i_ino, sync, (size_t) data->args.count,
offset, ds->ds_remotestr, atomic_read(&ds->ds_clp->cl_count)); offset, ds->ds_remotestr, atomic_read(&ds->ds_clp->cl_count));
data->write_done_cb = filelayout_write_done_cb; data->pgio_done_cb = filelayout_write_done_cb;
atomic_inc(&ds->ds_clp->cl_count); atomic_inc(&ds->ds_clp->cl_count);
data->ds_clp = ds->ds_clp; data->ds_clp = ds->ds_clp;
fh = nfs4_fl_select_ds_fh(lseg, j); fh = nfs4_fl_select_ds_fh(lseg, j);
......
...@@ -4033,12 +4033,12 @@ static bool nfs4_error_stateid_expired(int err) ...@@ -4033,12 +4033,12 @@ static bool nfs4_error_stateid_expired(int err)
return false; return false;
} }
void __nfs4_read_done_cb(struct nfs_read_data *data) void __nfs4_read_done_cb(struct nfs_pgio_data *data)
{ {
nfs_invalidate_atime(data->header->inode); nfs_invalidate_atime(data->header->inode);
} }
static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_read_data *data) static int nfs4_read_done_cb(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct nfs_server *server = NFS_SERVER(data->header->inode); struct nfs_server *server = NFS_SERVER(data->header->inode);
...@@ -4068,7 +4068,7 @@ static bool nfs4_read_stateid_changed(struct rpc_task *task, ...@@ -4068,7 +4068,7 @@ static bool nfs4_read_stateid_changed(struct rpc_task *task,
return true; return true;
} }
static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data) static int nfs4_read_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
dprintk("--> %s\n", __func__); dprintk("--> %s\n", __func__);
...@@ -4077,19 +4077,19 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data) ...@@ -4077,19 +4077,19 @@ static int nfs4_read_done(struct rpc_task *task, struct nfs_read_data *data)
return -EAGAIN; return -EAGAIN;
if (nfs4_read_stateid_changed(task, &data->args)) if (nfs4_read_stateid_changed(task, &data->args))
return -EAGAIN; return -EAGAIN;
return data->read_done_cb ? data->read_done_cb(task, data) : return data->pgio_done_cb ? data->pgio_done_cb(task, data) :
nfs4_read_done_cb(task, data); nfs4_read_done_cb(task, data);
} }
static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg) static void nfs4_proc_read_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
data->timestamp = jiffies; data->timestamp = jiffies;
data->read_done_cb = nfs4_read_done_cb; data->pgio_done_cb = nfs4_read_done_cb;
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ]; msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_READ];
nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 0); nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 0);
} }
static int nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) static int nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
if (nfs4_setup_sequence(NFS_SERVER(data->header->inode), if (nfs4_setup_sequence(NFS_SERVER(data->header->inode),
&data->args.seq_args, &data->args.seq_args,
...@@ -4104,7 +4104,7 @@ static int nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_dat ...@@ -4104,7 +4104,7 @@ static int nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_dat
return 0; return 0;
} }
static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_write_data *data) static int nfs4_write_done_cb(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -4134,18 +4134,18 @@ static bool nfs4_write_stateid_changed(struct rpc_task *task, ...@@ -4134,18 +4134,18 @@ static bool nfs4_write_stateid_changed(struct rpc_task *task,
return true; return true;
} }
static int nfs4_write_done(struct rpc_task *task, struct nfs_write_data *data) static int nfs4_write_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
if (!nfs4_sequence_done(task, &data->res.seq_res)) if (!nfs4_sequence_done(task, &data->res.seq_res))
return -EAGAIN; return -EAGAIN;
if (nfs4_write_stateid_changed(task, &data->args)) if (nfs4_write_stateid_changed(task, &data->args))
return -EAGAIN; return -EAGAIN;
return data->write_done_cb ? data->write_done_cb(task, data) : return data->pgio_done_cb ? data->pgio_done_cb(task, data) :
nfs4_write_done_cb(task, data); nfs4_write_done_cb(task, data);
} }
static static
bool nfs4_write_need_cache_consistency_data(const struct nfs_write_data *data) bool nfs4_write_need_cache_consistency_data(const struct nfs_pgio_data *data)
{ {
const struct nfs_pgio_header *hdr = data->header; const struct nfs_pgio_header *hdr = data->header;
...@@ -4158,7 +4158,7 @@ bool nfs4_write_need_cache_consistency_data(const struct nfs_write_data *data) ...@@ -4158,7 +4158,7 @@ bool nfs4_write_need_cache_consistency_data(const struct nfs_write_data *data)
return nfs4_have_delegation(hdr->inode, FMODE_READ) == 0; return nfs4_have_delegation(hdr->inode, FMODE_READ) == 0;
} }
static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) static void nfs4_proc_write_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
struct nfs_server *server = NFS_SERVER(data->header->inode); struct nfs_server *server = NFS_SERVER(data->header->inode);
...@@ -4168,8 +4168,8 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag ...@@ -4168,8 +4168,8 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
} else } else
data->args.bitmask = server->cache_consistency_bitmask; data->args.bitmask = server->cache_consistency_bitmask;
if (!data->write_done_cb) if (!data->pgio_done_cb)
data->write_done_cb = nfs4_write_done_cb; data->pgio_done_cb = nfs4_write_done_cb;
data->res.server = server; data->res.server = server;
data->timestamp = jiffies; data->timestamp = jiffies;
...@@ -4177,7 +4177,7 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag ...@@ -4177,7 +4177,7 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1); nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 1);
} }
static int nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data) static int nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
if (nfs4_setup_sequence(NFS_SERVER(data->header->inode), if (nfs4_setup_sequence(NFS_SERVER(data->header->inode),
&data->args.seq_args, &data->args.seq_args,
......
...@@ -932,7 +932,7 @@ DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group); ...@@ -932,7 +932,7 @@ DEFINE_NFS4_IDMAP_EVENT(nfs4_map_gid_to_group);
DECLARE_EVENT_CLASS(nfs4_read_event, DECLARE_EVENT_CLASS(nfs4_read_event,
TP_PROTO( TP_PROTO(
const struct nfs_read_data *data, const struct nfs_pgio_data *data,
int error int error
), ),
...@@ -972,7 +972,7 @@ DECLARE_EVENT_CLASS(nfs4_read_event, ...@@ -972,7 +972,7 @@ DECLARE_EVENT_CLASS(nfs4_read_event,
#define DEFINE_NFS4_READ_EVENT(name) \ #define DEFINE_NFS4_READ_EVENT(name) \
DEFINE_EVENT(nfs4_read_event, name, \ DEFINE_EVENT(nfs4_read_event, name, \
TP_PROTO( \ TP_PROTO( \
const struct nfs_read_data *data, \ const struct nfs_pgio_data *data, \
int error \ int error \
), \ ), \
TP_ARGS(data, error)) TP_ARGS(data, error))
...@@ -983,7 +983,7 @@ DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read); ...@@ -983,7 +983,7 @@ DEFINE_NFS4_READ_EVENT(nfs4_pnfs_read);
DECLARE_EVENT_CLASS(nfs4_write_event, DECLARE_EVENT_CLASS(nfs4_write_event,
TP_PROTO( TP_PROTO(
const struct nfs_write_data *data, const struct nfs_pgio_data *data,
int error int error
), ),
...@@ -1024,7 +1024,7 @@ DECLARE_EVENT_CLASS(nfs4_write_event, ...@@ -1024,7 +1024,7 @@ DECLARE_EVENT_CLASS(nfs4_write_event,
#define DEFINE_NFS4_WRITE_EVENT(name) \ #define DEFINE_NFS4_WRITE_EVENT(name) \
DEFINE_EVENT(nfs4_write_event, name, \ DEFINE_EVENT(nfs4_write_event, name, \
TP_PROTO( \ TP_PROTO( \
const struct nfs_write_data *data, \ const struct nfs_pgio_data *data, \
int error \ int error \
), \ ), \
TP_ARGS(data, error)) TP_ARGS(data, error))
......
...@@ -439,7 +439,7 @@ static void _read_done(struct ore_io_state *ios, void *private) ...@@ -439,7 +439,7 @@ static void _read_done(struct ore_io_state *ios, void *private)
objlayout_read_done(&objios->oir, status, objios->sync); objlayout_read_done(&objios->oir, status, objios->sync);
} }
int objio_read_pagelist(struct nfs_read_data *rdata) int objio_read_pagelist(struct nfs_pgio_data *rdata)
{ {
struct nfs_pgio_header *hdr = rdata->header; struct nfs_pgio_header *hdr = rdata->header;
struct objio_state *objios; struct objio_state *objios;
...@@ -487,7 +487,7 @@ static void _write_done(struct ore_io_state *ios, void *private) ...@@ -487,7 +487,7 @@ static void _write_done(struct ore_io_state *ios, void *private)
static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate) static struct page *__r4w_get_page(void *priv, u64 offset, bool *uptodate)
{ {
struct objio_state *objios = priv; struct objio_state *objios = priv;
struct nfs_write_data *wdata = objios->oir.rpcdata; struct nfs_pgio_data *wdata = objios->oir.rpcdata;
struct address_space *mapping = wdata->header->inode->i_mapping; struct address_space *mapping = wdata->header->inode->i_mapping;
pgoff_t index = offset / PAGE_SIZE; pgoff_t index = offset / PAGE_SIZE;
struct page *page; struct page *page;
...@@ -531,7 +531,7 @@ static const struct _ore_r4w_op _r4w_op = { ...@@ -531,7 +531,7 @@ static const struct _ore_r4w_op _r4w_op = {
.put_page = &__r4w_put_page, .put_page = &__r4w_put_page,
}; };
int objio_write_pagelist(struct nfs_write_data *wdata, int how) int objio_write_pagelist(struct nfs_pgio_data *wdata, int how)
{ {
struct nfs_pgio_header *hdr = wdata->header; struct nfs_pgio_header *hdr = wdata->header;
struct objio_state *objios; struct objio_state *objios;
......
...@@ -229,11 +229,11 @@ objlayout_io_set_result(struct objlayout_io_res *oir, unsigned index, ...@@ -229,11 +229,11 @@ objlayout_io_set_result(struct objlayout_io_res *oir, unsigned index,
static void _rpc_read_complete(struct work_struct *work) static void _rpc_read_complete(struct work_struct *work)
{ {
struct rpc_task *task; struct rpc_task *task;
struct nfs_read_data *rdata; struct nfs_pgio_data *rdata;
dprintk("%s enter\n", __func__); dprintk("%s enter\n", __func__);
task = container_of(work, struct rpc_task, u.tk_work); task = container_of(work, struct rpc_task, u.tk_work);
rdata = container_of(task, struct nfs_read_data, task); rdata = container_of(task, struct nfs_pgio_data, task);
pnfs_ld_read_done(rdata); pnfs_ld_read_done(rdata);
} }
...@@ -241,7 +241,7 @@ static void _rpc_read_complete(struct work_struct *work) ...@@ -241,7 +241,7 @@ static void _rpc_read_complete(struct work_struct *work)
void void
objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync) objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
{ {
struct nfs_read_data *rdata = oir->rpcdata; struct nfs_pgio_data *rdata = oir->rpcdata;
oir->status = rdata->task.tk_status = status; oir->status = rdata->task.tk_status = status;
if (status >= 0) if (status >= 0)
...@@ -266,7 +266,7 @@ objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync) ...@@ -266,7 +266,7 @@ objlayout_read_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
* Perform sync or async reads. * Perform sync or async reads.
*/ */
enum pnfs_try_status enum pnfs_try_status
objlayout_read_pagelist(struct nfs_read_data *rdata) objlayout_read_pagelist(struct nfs_pgio_data *rdata)
{ {
struct nfs_pgio_header *hdr = rdata->header; struct nfs_pgio_header *hdr = rdata->header;
struct inode *inode = hdr->inode; struct inode *inode = hdr->inode;
...@@ -312,11 +312,11 @@ objlayout_read_pagelist(struct nfs_read_data *rdata) ...@@ -312,11 +312,11 @@ objlayout_read_pagelist(struct nfs_read_data *rdata)
static void _rpc_write_complete(struct work_struct *work) static void _rpc_write_complete(struct work_struct *work)
{ {
struct rpc_task *task; struct rpc_task *task;
struct nfs_write_data *wdata; struct nfs_pgio_data *wdata;
dprintk("%s enter\n", __func__); dprintk("%s enter\n", __func__);
task = container_of(work, struct rpc_task, u.tk_work); task = container_of(work, struct rpc_task, u.tk_work);
wdata = container_of(task, struct nfs_write_data, task); wdata = container_of(task, struct nfs_pgio_data, task);
pnfs_ld_write_done(wdata); pnfs_ld_write_done(wdata);
} }
...@@ -324,7 +324,7 @@ static void _rpc_write_complete(struct work_struct *work) ...@@ -324,7 +324,7 @@ static void _rpc_write_complete(struct work_struct *work)
void void
objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
{ {
struct nfs_write_data *wdata = oir->rpcdata; struct nfs_pgio_data *wdata = oir->rpcdata;
oir->status = wdata->task.tk_status = status; oir->status = wdata->task.tk_status = status;
if (status >= 0) { if (status >= 0) {
...@@ -351,7 +351,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync) ...@@ -351,7 +351,7 @@ objlayout_write_done(struct objlayout_io_res *oir, ssize_t status, bool sync)
* Perform sync or async writes. * Perform sync or async writes.
*/ */
enum pnfs_try_status enum pnfs_try_status
objlayout_write_pagelist(struct nfs_write_data *wdata, objlayout_write_pagelist(struct nfs_pgio_data *wdata,
int how) int how)
{ {
struct nfs_pgio_header *hdr = wdata->header; struct nfs_pgio_header *hdr = wdata->header;
......
...@@ -119,8 +119,8 @@ extern void objio_free_lseg(struct pnfs_layout_segment *lseg); ...@@ -119,8 +119,8 @@ extern void objio_free_lseg(struct pnfs_layout_segment *lseg);
*/ */
extern void objio_free_result(struct objlayout_io_res *oir); extern void objio_free_result(struct objlayout_io_res *oir);
extern int objio_read_pagelist(struct nfs_read_data *rdata); extern int objio_read_pagelist(struct nfs_pgio_data *rdata);
extern int objio_write_pagelist(struct nfs_write_data *wdata, int how); extern int objio_write_pagelist(struct nfs_pgio_data *wdata, int how);
/* /*
* callback API * callback API
...@@ -168,10 +168,10 @@ extern struct pnfs_layout_segment *objlayout_alloc_lseg( ...@@ -168,10 +168,10 @@ extern struct pnfs_layout_segment *objlayout_alloc_lseg(
extern void objlayout_free_lseg(struct pnfs_layout_segment *); extern void objlayout_free_lseg(struct pnfs_layout_segment *);
extern enum pnfs_try_status objlayout_read_pagelist( extern enum pnfs_try_status objlayout_read_pagelist(
struct nfs_read_data *); struct nfs_pgio_data *);
extern enum pnfs_try_status objlayout_write_pagelist( extern enum pnfs_try_status objlayout_write_pagelist(
struct nfs_write_data *, struct nfs_pgio_data *,
int how); int how);
extern void objlayout_encode_layoutcommit( extern void objlayout_encode_layoutcommit(
......
...@@ -1492,7 +1492,7 @@ int pnfs_write_done_resend_to_mds(struct inode *inode, ...@@ -1492,7 +1492,7 @@ int pnfs_write_done_resend_to_mds(struct inode *inode,
} }
EXPORT_SYMBOL_GPL(pnfs_write_done_resend_to_mds); EXPORT_SYMBOL_GPL(pnfs_write_done_resend_to_mds);
static void pnfs_ld_handle_write_error(struct nfs_write_data *data) static void pnfs_ld_handle_write_error(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1511,7 +1511,7 @@ static void pnfs_ld_handle_write_error(struct nfs_write_data *data) ...@@ -1511,7 +1511,7 @@ static void pnfs_ld_handle_write_error(struct nfs_write_data *data)
/* /*
* Called by non rpc-based layout drivers * Called by non rpc-based layout drivers
*/ */
void pnfs_ld_write_done(struct nfs_write_data *data) void pnfs_ld_write_done(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1527,7 +1527,7 @@ EXPORT_SYMBOL_GPL(pnfs_ld_write_done); ...@@ -1527,7 +1527,7 @@ EXPORT_SYMBOL_GPL(pnfs_ld_write_done);
static void static void
pnfs_write_through_mds(struct nfs_pageio_descriptor *desc, pnfs_write_through_mds(struct nfs_pageio_descriptor *desc,
struct nfs_write_data *data) struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1540,7 +1540,7 @@ pnfs_write_through_mds(struct nfs_pageio_descriptor *desc, ...@@ -1540,7 +1540,7 @@ pnfs_write_through_mds(struct nfs_pageio_descriptor *desc,
} }
static enum pnfs_try_status static enum pnfs_try_status
pnfs_try_to_write_data(struct nfs_write_data *wdata, pnfs_try_to_write_data(struct nfs_pgio_data *wdata,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
struct pnfs_layout_segment *lseg, struct pnfs_layout_segment *lseg,
int how) int how)
...@@ -1564,7 +1564,7 @@ pnfs_try_to_write_data(struct nfs_write_data *wdata, ...@@ -1564,7 +1564,7 @@ pnfs_try_to_write_data(struct nfs_write_data *wdata,
static void static void
pnfs_do_multiple_writes(struct nfs_pageio_descriptor *desc, struct list_head *head, int how) pnfs_do_multiple_writes(struct nfs_pageio_descriptor *desc, struct list_head *head, int how)
{ {
struct nfs_write_data *data; struct nfs_pgio_data *data;
const struct rpc_call_ops *call_ops = desc->pg_rpc_callops; const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
struct pnfs_layout_segment *lseg = desc->pg_lseg; struct pnfs_layout_segment *lseg = desc->pg_lseg;
...@@ -1572,7 +1572,7 @@ pnfs_do_multiple_writes(struct nfs_pageio_descriptor *desc, struct list_head *he ...@@ -1572,7 +1572,7 @@ pnfs_do_multiple_writes(struct nfs_pageio_descriptor *desc, struct list_head *he
while (!list_empty(head)) { while (!list_empty(head)) {
enum pnfs_try_status trypnfs; enum pnfs_try_status trypnfs;
data = list_first_entry(head, struct nfs_write_data, list); data = list_first_entry(head, struct nfs_pgio_data, list);
list_del_init(&data->list); list_del_init(&data->list);
trypnfs = pnfs_try_to_write_data(data, call_ops, lseg, how); trypnfs = pnfs_try_to_write_data(data, call_ops, lseg, how);
...@@ -1647,7 +1647,7 @@ int pnfs_read_done_resend_to_mds(struct inode *inode, ...@@ -1647,7 +1647,7 @@ int pnfs_read_done_resend_to_mds(struct inode *inode,
} }
EXPORT_SYMBOL_GPL(pnfs_read_done_resend_to_mds); EXPORT_SYMBOL_GPL(pnfs_read_done_resend_to_mds);
static void pnfs_ld_handle_read_error(struct nfs_read_data *data) static void pnfs_ld_handle_read_error(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1666,7 +1666,7 @@ static void pnfs_ld_handle_read_error(struct nfs_read_data *data) ...@@ -1666,7 +1666,7 @@ static void pnfs_ld_handle_read_error(struct nfs_read_data *data)
/* /*
* Called by non rpc-based layout drivers * Called by non rpc-based layout drivers
*/ */
void pnfs_ld_read_done(struct nfs_read_data *data) void pnfs_ld_read_done(struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1682,7 +1682,7 @@ EXPORT_SYMBOL_GPL(pnfs_ld_read_done); ...@@ -1682,7 +1682,7 @@ EXPORT_SYMBOL_GPL(pnfs_ld_read_done);
static void static void
pnfs_read_through_mds(struct nfs_pageio_descriptor *desc, pnfs_read_through_mds(struct nfs_pageio_descriptor *desc,
struct nfs_read_data *data) struct nfs_pgio_data *data)
{ {
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
...@@ -1698,7 +1698,7 @@ pnfs_read_through_mds(struct nfs_pageio_descriptor *desc, ...@@ -1698,7 +1698,7 @@ pnfs_read_through_mds(struct nfs_pageio_descriptor *desc,
* Call the appropriate parallel I/O subsystem read function. * Call the appropriate parallel I/O subsystem read function.
*/ */
static enum pnfs_try_status static enum pnfs_try_status
pnfs_try_to_read_data(struct nfs_read_data *rdata, pnfs_try_to_read_data(struct nfs_pgio_data *rdata,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
struct pnfs_layout_segment *lseg) struct pnfs_layout_segment *lseg)
{ {
...@@ -1722,7 +1722,7 @@ pnfs_try_to_read_data(struct nfs_read_data *rdata, ...@@ -1722,7 +1722,7 @@ pnfs_try_to_read_data(struct nfs_read_data *rdata,
static void static void
pnfs_do_multiple_reads(struct nfs_pageio_descriptor *desc, struct list_head *head) pnfs_do_multiple_reads(struct nfs_pageio_descriptor *desc, struct list_head *head)
{ {
struct nfs_read_data *data; struct nfs_pgio_data *data;
const struct rpc_call_ops *call_ops = desc->pg_rpc_callops; const struct rpc_call_ops *call_ops = desc->pg_rpc_callops;
struct pnfs_layout_segment *lseg = desc->pg_lseg; struct pnfs_layout_segment *lseg = desc->pg_lseg;
...@@ -1730,7 +1730,7 @@ pnfs_do_multiple_reads(struct nfs_pageio_descriptor *desc, struct list_head *hea ...@@ -1730,7 +1730,7 @@ pnfs_do_multiple_reads(struct nfs_pageio_descriptor *desc, struct list_head *hea
while (!list_empty(head)) { while (!list_empty(head)) {
enum pnfs_try_status trypnfs; enum pnfs_try_status trypnfs;
data = list_first_entry(head, struct nfs_read_data, list); data = list_first_entry(head, struct nfs_pgio_data, list);
list_del_init(&data->list); list_del_init(&data->list);
trypnfs = pnfs_try_to_read_data(data, call_ops, lseg); trypnfs = pnfs_try_to_read_data(data, call_ops, lseg);
...@@ -1821,7 +1821,7 @@ void pnfs_set_lo_fail(struct pnfs_layout_segment *lseg) ...@@ -1821,7 +1821,7 @@ void pnfs_set_lo_fail(struct pnfs_layout_segment *lseg)
EXPORT_SYMBOL_GPL(pnfs_set_lo_fail); EXPORT_SYMBOL_GPL(pnfs_set_lo_fail);
void void
pnfs_set_layoutcommit(struct nfs_write_data *wdata) pnfs_set_layoutcommit(struct nfs_pgio_data *wdata)
{ {
struct nfs_pgio_header *hdr = wdata->header; struct nfs_pgio_header *hdr = wdata->header;
struct inode *inode = hdr->inode; struct inode *inode = hdr->inode;
......
...@@ -113,8 +113,8 @@ struct pnfs_layoutdriver_type { ...@@ -113,8 +113,8 @@ struct pnfs_layoutdriver_type {
* Return PNFS_ATTEMPTED to indicate the layout code has attempted * Return PNFS_ATTEMPTED to indicate the layout code has attempted
* I/O, else return PNFS_NOT_ATTEMPTED to fall back to normal NFS * I/O, else return PNFS_NOT_ATTEMPTED to fall back to normal NFS
*/ */
enum pnfs_try_status (*read_pagelist) (struct nfs_read_data *nfs_data); enum pnfs_try_status (*read_pagelist) (struct nfs_pgio_data *nfs_data);
enum pnfs_try_status (*write_pagelist) (struct nfs_write_data *nfs_data, int how); enum pnfs_try_status (*write_pagelist) (struct nfs_pgio_data *nfs_data, int how);
void (*free_deviceid_node) (struct nfs4_deviceid_node *); void (*free_deviceid_node) (struct nfs4_deviceid_node *);
...@@ -212,13 +212,13 @@ bool pnfs_roc(struct inode *ino); ...@@ -212,13 +212,13 @@ bool pnfs_roc(struct inode *ino);
void pnfs_roc_release(struct inode *ino); void pnfs_roc_release(struct inode *ino);
void pnfs_roc_set_barrier(struct inode *ino, u32 barrier); void pnfs_roc_set_barrier(struct inode *ino, u32 barrier);
bool pnfs_roc_drain(struct inode *ino, u32 *barrier, struct rpc_task *task); bool pnfs_roc_drain(struct inode *ino, u32 *barrier, struct rpc_task *task);
void pnfs_set_layoutcommit(struct nfs_write_data *wdata); void pnfs_set_layoutcommit(struct nfs_pgio_data *wdata);
void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data); void pnfs_cleanup_layoutcommit(struct nfs4_layoutcommit_data *data);
int pnfs_layoutcommit_inode(struct inode *inode, bool sync); int pnfs_layoutcommit_inode(struct inode *inode, bool sync);
int _pnfs_return_layout(struct inode *); int _pnfs_return_layout(struct inode *);
int pnfs_commit_and_return_layout(struct inode *); int pnfs_commit_and_return_layout(struct inode *);
void pnfs_ld_write_done(struct nfs_write_data *); void pnfs_ld_write_done(struct nfs_pgio_data *);
void pnfs_ld_read_done(struct nfs_read_data *); void pnfs_ld_read_done(struct nfs_pgio_data *);
struct pnfs_layout_segment *pnfs_update_layout(struct inode *ino, struct pnfs_layout_segment *pnfs_update_layout(struct inode *ino,
struct nfs_open_context *ctx, struct nfs_open_context *ctx,
loff_t pos, loff_t pos,
......
...@@ -578,7 +578,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle, ...@@ -578,7 +578,7 @@ nfs_proc_pathconf(struct nfs_server *server, struct nfs_fh *fhandle,
return 0; return 0;
} }
static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data) static int nfs_read_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -594,18 +594,18 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data) ...@@ -594,18 +594,18 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
return 0; return 0;
} }
static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg) static void nfs_proc_read_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
msg->rpc_proc = &nfs_procedures[NFSPROC_READ]; msg->rpc_proc = &nfs_procedures[NFSPROC_READ];
} }
static int nfs_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) static int nfs_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
rpc_call_start(task); rpc_call_start(task);
return 0; return 0;
} }
static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) static int nfs_write_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -614,14 +614,14 @@ static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) ...@@ -614,14 +614,14 @@ static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
return 0; return 0;
} }
static void nfs_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg) static void nfs_proc_write_setup(struct nfs_pgio_data *data, struct rpc_message *msg)
{ {
/* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */ /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */
data->args.stable = NFS_FILE_SYNC; data->args.stable = NFS_FILE_SYNC;
msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE]; msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE];
} }
static int nfs_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data) static int nfs_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
rpc_call_start(task); rpc_call_start(task);
return 0; return 0;
......
...@@ -51,10 +51,10 @@ struct nfs_read_header *nfs_readhdr_alloc(void) ...@@ -51,10 +51,10 @@ struct nfs_read_header *nfs_readhdr_alloc(void)
} }
EXPORT_SYMBOL_GPL(nfs_readhdr_alloc); EXPORT_SYMBOL_GPL(nfs_readhdr_alloc);
static struct nfs_read_data *nfs_readdata_alloc(struct nfs_pgio_header *hdr, static struct nfs_pgio_data *nfs_readdata_alloc(struct nfs_pgio_header *hdr,
unsigned int pagecount) unsigned int pagecount)
{ {
struct nfs_read_data *data, *prealloc; struct nfs_pgio_data *data, *prealloc;
prealloc = &container_of(hdr, struct nfs_read_header, header)->rpc_data; prealloc = &container_of(hdr, struct nfs_read_header, header)->rpc_data;
if (prealloc->header == NULL) if (prealloc->header == NULL)
...@@ -84,7 +84,7 @@ void nfs_readhdr_free(struct nfs_pgio_header *hdr) ...@@ -84,7 +84,7 @@ void nfs_readhdr_free(struct nfs_pgio_header *hdr)
} }
EXPORT_SYMBOL_GPL(nfs_readhdr_free); EXPORT_SYMBOL_GPL(nfs_readhdr_free);
void nfs_readdata_release(struct nfs_read_data *rdata) void nfs_readdata_release(struct nfs_pgio_data *rdata)
{ {
struct nfs_pgio_header *hdr = rdata->header; struct nfs_pgio_header *hdr = rdata->header;
struct nfs_read_header *read_header = container_of(hdr, struct nfs_read_header, header); struct nfs_read_header *read_header = container_of(hdr, struct nfs_read_header, header);
...@@ -212,7 +212,7 @@ static void nfs_read_completion(struct nfs_pgio_header *hdr) ...@@ -212,7 +212,7 @@ static void nfs_read_completion(struct nfs_pgio_header *hdr)
} }
int nfs_initiate_read(struct rpc_clnt *clnt, int nfs_initiate_read(struct rpc_clnt *clnt,
struct nfs_read_data *data, struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops, int flags) const struct rpc_call_ops *call_ops, int flags)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -255,7 +255,7 @@ EXPORT_SYMBOL_GPL(nfs_initiate_read); ...@@ -255,7 +255,7 @@ EXPORT_SYMBOL_GPL(nfs_initiate_read);
/* /*
* Set up the NFS read request struct * Set up the NFS read request struct
*/ */
static void nfs_read_rpcsetup(struct nfs_read_data *data, static void nfs_read_rpcsetup(struct nfs_pgio_data *data,
unsigned int count, unsigned int offset) unsigned int count, unsigned int offset)
{ {
struct nfs_page *req = data->header->req; struct nfs_page *req = data->header->req;
...@@ -274,7 +274,7 @@ static void nfs_read_rpcsetup(struct nfs_read_data *data, ...@@ -274,7 +274,7 @@ static void nfs_read_rpcsetup(struct nfs_read_data *data,
nfs_fattr_init(&data->fattr); nfs_fattr_init(&data->fattr);
} }
static int nfs_do_read(struct nfs_read_data *data, static int nfs_do_read(struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops) const struct rpc_call_ops *call_ops)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
...@@ -286,13 +286,13 @@ static int ...@@ -286,13 +286,13 @@ static int
nfs_do_multiple_reads(struct list_head *head, nfs_do_multiple_reads(struct list_head *head,
const struct rpc_call_ops *call_ops) const struct rpc_call_ops *call_ops)
{ {
struct nfs_read_data *data; struct nfs_pgio_data *data;
int ret = 0; int ret = 0;
while (!list_empty(head)) { while (!list_empty(head)) {
int ret2; int ret2;
data = list_first_entry(head, struct nfs_read_data, list); data = list_first_entry(head, struct nfs_pgio_data, list);
list_del_init(&data->list); list_del_init(&data->list);
ret2 = nfs_do_read(data, call_ops); ret2 = nfs_do_read(data, call_ops);
...@@ -324,8 +324,8 @@ static void nfs_pagein_error(struct nfs_pageio_descriptor *desc, ...@@ -324,8 +324,8 @@ static void nfs_pagein_error(struct nfs_pageio_descriptor *desc,
{ {
set_bit(NFS_IOHDR_REDO, &hdr->flags); set_bit(NFS_IOHDR_REDO, &hdr->flags);
while (!list_empty(&hdr->rpc_list)) { while (!list_empty(&hdr->rpc_list)) {
struct nfs_read_data *data = list_first_entry(&hdr->rpc_list, struct nfs_pgio_data *data = list_first_entry(&hdr->rpc_list,
struct nfs_read_data, list); struct nfs_pgio_data, list);
list_del(&data->list); list_del(&data->list);
nfs_readdata_release(data); nfs_readdata_release(data);
} }
...@@ -350,7 +350,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, ...@@ -350,7 +350,7 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc,
{ {
struct nfs_page *req = hdr->req; struct nfs_page *req = hdr->req;
struct page *page = req->wb_page; struct page *page = req->wb_page;
struct nfs_read_data *data; struct nfs_pgio_data *data;
size_t rsize = desc->pg_bsize, nbytes; size_t rsize = desc->pg_bsize, nbytes;
unsigned int offset; unsigned int offset;
...@@ -382,7 +382,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc, ...@@ -382,7 +382,7 @@ static int nfs_pagein_one(struct nfs_pageio_descriptor *desc,
{ {
struct nfs_page *req; struct nfs_page *req;
struct page **pages; struct page **pages;
struct nfs_read_data *data; struct nfs_pgio_data *data;
struct list_head *head = &desc->pg_list; struct list_head *head = &desc->pg_list;
data = nfs_readdata_alloc(hdr, nfs_page_array_len(desc->pg_base, data = nfs_readdata_alloc(hdr, nfs_page_array_len(desc->pg_base,
...@@ -447,7 +447,7 @@ static const struct nfs_pageio_ops nfs_pageio_read_ops = { ...@@ -447,7 +447,7 @@ static const struct nfs_pageio_ops nfs_pageio_read_ops = {
* This is the callback from RPC telling us whether a reply was * This is the callback from RPC telling us whether a reply was
* received or some error occurred (timeout or socket shutdown). * received or some error occurred (timeout or socket shutdown).
*/ */
int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) int nfs_readpage_result(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct inode *inode = data->header->inode; struct inode *inode = data->header->inode;
int status; int status;
...@@ -468,7 +468,7 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data) ...@@ -468,7 +468,7 @@ int nfs_readpage_result(struct rpc_task *task, struct nfs_read_data *data)
return 0; return 0;
} }
static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data) static void nfs_readpage_retry(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct nfs_pgio_args *argp = &data->args; struct nfs_pgio_args *argp = &data->args;
struct nfs_pgio_res *resp = &data->res; struct nfs_pgio_res *resp = &data->res;
...@@ -490,7 +490,7 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data ...@@ -490,7 +490,7 @@ static void nfs_readpage_retry(struct rpc_task *task, struct nfs_read_data *data
static void nfs_readpage_result_common(struct rpc_task *task, void *calldata) static void nfs_readpage_result_common(struct rpc_task *task, void *calldata)
{ {
struct nfs_read_data *data = calldata; struct nfs_pgio_data *data = calldata;
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
/* Note the only returns of nfs_readpage_result are 0 and -EAGAIN */ /* Note the only returns of nfs_readpage_result are 0 and -EAGAIN */
...@@ -520,7 +520,7 @@ static void nfs_readpage_release_common(void *calldata) ...@@ -520,7 +520,7 @@ static void nfs_readpage_release_common(void *calldata)
void nfs_read_prepare(struct rpc_task *task, void *calldata) void nfs_read_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs_read_data *data = calldata; struct nfs_pgio_data *data = calldata;
int err; int err;
err = NFS_PROTO(data->header->inode)->read_rpc_prepare(task, data); err = NFS_PROTO(data->header->inode)->read_rpc_prepare(task, data);
if (err) if (err)
......
...@@ -88,10 +88,10 @@ struct nfs_write_header *nfs_writehdr_alloc(void) ...@@ -88,10 +88,10 @@ struct nfs_write_header *nfs_writehdr_alloc(void)
} }
EXPORT_SYMBOL_GPL(nfs_writehdr_alloc); EXPORT_SYMBOL_GPL(nfs_writehdr_alloc);
static struct nfs_write_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr, static struct nfs_pgio_data *nfs_writedata_alloc(struct nfs_pgio_header *hdr,
unsigned int pagecount) unsigned int pagecount)
{ {
struct nfs_write_data *data, *prealloc; struct nfs_pgio_data *data, *prealloc;
prealloc = &container_of(hdr, struct nfs_write_header, header)->rpc_data; prealloc = &container_of(hdr, struct nfs_write_header, header)->rpc_data;
if (prealloc->header == NULL) if (prealloc->header == NULL)
...@@ -120,7 +120,7 @@ void nfs_writehdr_free(struct nfs_pgio_header *hdr) ...@@ -120,7 +120,7 @@ void nfs_writehdr_free(struct nfs_pgio_header *hdr)
} }
EXPORT_SYMBOL_GPL(nfs_writehdr_free); EXPORT_SYMBOL_GPL(nfs_writehdr_free);
void nfs_writedata_release(struct nfs_write_data *wdata) void nfs_writedata_release(struct nfs_pgio_data *wdata)
{ {
struct nfs_pgio_header *hdr = wdata->header; struct nfs_pgio_header *hdr = wdata->header;
struct nfs_write_header *write_header = container_of(hdr, struct nfs_write_header, header); struct nfs_write_header *write_header = container_of(hdr, struct nfs_write_header, header);
...@@ -582,7 +582,7 @@ nfs_clear_request_commit(struct nfs_page *req) ...@@ -582,7 +582,7 @@ nfs_clear_request_commit(struct nfs_page *req)
} }
static inline static inline
int nfs_write_need_commit(struct nfs_write_data *data) int nfs_write_need_commit(struct nfs_pgio_data *data)
{ {
if (data->verf.committed == NFS_DATA_SYNC) if (data->verf.committed == NFS_DATA_SYNC)
return data->header->lseg == NULL; return data->header->lseg == NULL;
...@@ -613,7 +613,7 @@ nfs_clear_request_commit(struct nfs_page *req) ...@@ -613,7 +613,7 @@ nfs_clear_request_commit(struct nfs_page *req)
} }
static inline static inline
int nfs_write_need_commit(struct nfs_write_data *data) int nfs_write_need_commit(struct nfs_pgio_data *data)
{ {
return 0; return 0;
} }
...@@ -990,7 +990,7 @@ static int flush_task_priority(int how) ...@@ -990,7 +990,7 @@ static int flush_task_priority(int how)
} }
int nfs_initiate_write(struct rpc_clnt *clnt, int nfs_initiate_write(struct rpc_clnt *clnt,
struct nfs_write_data *data, struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
int how, int flags) int how, int flags)
{ {
...@@ -1047,7 +1047,7 @@ EXPORT_SYMBOL_GPL(nfs_initiate_write); ...@@ -1047,7 +1047,7 @@ EXPORT_SYMBOL_GPL(nfs_initiate_write);
/* /*
* Set up the argument/result storage required for the RPC call. * Set up the argument/result storage required for the RPC call.
*/ */
static void nfs_write_rpcsetup(struct nfs_write_data *data, static void nfs_write_rpcsetup(struct nfs_pgio_data *data,
unsigned int count, unsigned int offset, unsigned int count, unsigned int offset,
int how, struct nfs_commit_info *cinfo) int how, struct nfs_commit_info *cinfo)
{ {
...@@ -1082,7 +1082,7 @@ static void nfs_write_rpcsetup(struct nfs_write_data *data, ...@@ -1082,7 +1082,7 @@ static void nfs_write_rpcsetup(struct nfs_write_data *data,
nfs_fattr_init(&data->fattr); nfs_fattr_init(&data->fattr);
} }
static int nfs_do_write(struct nfs_write_data *data, static int nfs_do_write(struct nfs_pgio_data *data,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
int how) int how)
{ {
...@@ -1095,13 +1095,13 @@ static int nfs_do_multiple_writes(struct list_head *head, ...@@ -1095,13 +1095,13 @@ static int nfs_do_multiple_writes(struct list_head *head,
const struct rpc_call_ops *call_ops, const struct rpc_call_ops *call_ops,
int how) int how)
{ {
struct nfs_write_data *data; struct nfs_pgio_data *data;
int ret = 0; int ret = 0;
while (!list_empty(head)) { while (!list_empty(head)) {
int ret2; int ret2;
data = list_first_entry(head, struct nfs_write_data, list); data = list_first_entry(head, struct nfs_pgio_data, list);
list_del_init(&data->list); list_del_init(&data->list);
ret2 = nfs_do_write(data, call_ops, how); ret2 = nfs_do_write(data, call_ops, how);
...@@ -1144,8 +1144,8 @@ static void nfs_flush_error(struct nfs_pageio_descriptor *desc, ...@@ -1144,8 +1144,8 @@ static void nfs_flush_error(struct nfs_pageio_descriptor *desc,
{ {
set_bit(NFS_IOHDR_REDO, &hdr->flags); set_bit(NFS_IOHDR_REDO, &hdr->flags);
while (!list_empty(&hdr->rpc_list)) { while (!list_empty(&hdr->rpc_list)) {
struct nfs_write_data *data = list_first_entry(&hdr->rpc_list, struct nfs_pgio_data *data = list_first_entry(&hdr->rpc_list,
struct nfs_write_data, list); struct nfs_pgio_data, list);
list_del(&data->list); list_del(&data->list);
nfs_writedata_release(data); nfs_writedata_release(data);
} }
...@@ -1161,7 +1161,7 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc, ...@@ -1161,7 +1161,7 @@ static int nfs_flush_multi(struct nfs_pageio_descriptor *desc,
{ {
struct nfs_page *req = hdr->req; struct nfs_page *req = hdr->req;
struct page *page = req->wb_page; struct page *page = req->wb_page;
struct nfs_write_data *data; struct nfs_pgio_data *data;
size_t wsize = desc->pg_bsize, nbytes; size_t wsize = desc->pg_bsize, nbytes;
unsigned int offset; unsigned int offset;
int requests = 0; int requests = 0;
...@@ -1211,7 +1211,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc, ...@@ -1211,7 +1211,7 @@ static int nfs_flush_one(struct nfs_pageio_descriptor *desc,
{ {
struct nfs_page *req; struct nfs_page *req;
struct page **pages; struct page **pages;
struct nfs_write_data *data; struct nfs_pgio_data *data;
struct list_head *head = &desc->pg_list; struct list_head *head = &desc->pg_list;
struct nfs_commit_info cinfo; struct nfs_commit_info cinfo;
...@@ -1305,7 +1305,7 @@ EXPORT_SYMBOL_GPL(nfs_pageio_reset_write_mds); ...@@ -1305,7 +1305,7 @@ EXPORT_SYMBOL_GPL(nfs_pageio_reset_write_mds);
void nfs_write_prepare(struct rpc_task *task, void *calldata) void nfs_write_prepare(struct rpc_task *task, void *calldata)
{ {
struct nfs_write_data *data = calldata; struct nfs_pgio_data *data = calldata;
int err; int err;
err = NFS_PROTO(data->header->inode)->write_rpc_prepare(task, data); err = NFS_PROTO(data->header->inode)->write_rpc_prepare(task, data);
if (err) if (err)
...@@ -1328,14 +1328,14 @@ void nfs_commit_prepare(struct rpc_task *task, void *calldata) ...@@ -1328,14 +1328,14 @@ void nfs_commit_prepare(struct rpc_task *task, void *calldata)
*/ */
static void nfs_writeback_done_common(struct rpc_task *task, void *calldata) static void nfs_writeback_done_common(struct rpc_task *task, void *calldata)
{ {
struct nfs_write_data *data = calldata; struct nfs_pgio_data *data = calldata;
nfs_writeback_done(task, data); nfs_writeback_done(task, data);
} }
static void nfs_writeback_release_common(void *calldata) static void nfs_writeback_release_common(void *calldata)
{ {
struct nfs_write_data *data = calldata; struct nfs_pgio_data *data = calldata;
struct nfs_pgio_header *hdr = data->header; struct nfs_pgio_header *hdr = data->header;
int status = data->task.tk_status; int status = data->task.tk_status;
...@@ -1386,7 +1386,7 @@ static int nfs_should_remove_suid(const struct inode *inode) ...@@ -1386,7 +1386,7 @@ static int nfs_should_remove_suid(const struct inode *inode)
/* /*
* This function is called when the WRITE call is complete. * This function is called when the WRITE call is complete.
*/ */
void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data) void nfs_writeback_done(struct rpc_task *task, struct nfs_pgio_data *data)
{ {
struct nfs_pgio_args *argp = &data->args; struct nfs_pgio_args *argp = &data->args;
struct nfs_pgio_res *resp = &data->res; struct nfs_pgio_res *resp = &data->res;
......
...@@ -520,7 +520,7 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc); ...@@ -520,7 +520,7 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
extern int nfs_writepages(struct address_space *, struct writeback_control *); extern int nfs_writepages(struct address_space *, struct writeback_control *);
extern int nfs_flush_incompatible(struct file *file, struct page *page); extern int nfs_flush_incompatible(struct file *file, struct page *page);
extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
extern void nfs_writeback_done(struct rpc_task *, struct nfs_write_data *); extern void nfs_writeback_done(struct rpc_task *, struct nfs_pgio_data *);
/* /*
* Try to write back everything synchronously (but check the * Try to write back everything synchronously (but check the
...@@ -553,7 +553,7 @@ nfs_have_writebacks(struct inode *inode) ...@@ -553,7 +553,7 @@ nfs_have_writebacks(struct inode *inode)
extern int nfs_readpage(struct file *, struct page *); extern int nfs_readpage(struct file *, struct page *);
extern int nfs_readpages(struct file *, struct address_space *, extern int nfs_readpages(struct file *, struct address_space *,
struct list_head *, unsigned); struct list_head *, unsigned);
extern int nfs_readpage_result(struct rpc_task *, struct nfs_read_data *); extern int nfs_readpage_result(struct rpc_task *, struct nfs_pgio_data *);
extern int nfs_readpage_async(struct nfs_open_context *, struct inode *, extern int nfs_readpage_async(struct nfs_open_context *, struct inode *,
struct page *); struct page *);
......
...@@ -1247,20 +1247,6 @@ struct nfs_page_array { ...@@ -1247,20 +1247,6 @@ struct nfs_page_array {
struct page *page_array[NFS_PAGEVEC_SIZE]; struct page *page_array[NFS_PAGEVEC_SIZE];
}; };
struct nfs_read_data {
struct nfs_pgio_header *header;
struct list_head list;
struct rpc_task task;
struct nfs_fattr fattr; /* fattr storage */
struct nfs_pgio_args args;
struct nfs_pgio_res res;
unsigned long timestamp; /* For lease renewal */
int (*read_done_cb) (struct rpc_task *task, struct nfs_read_data *data);
__u64 mds_offset;
struct nfs_page_array pages;
struct nfs_client *ds_clp; /* pNFS data server */
};
/* used as flag bits in nfs_pgio_header */ /* used as flag bits in nfs_pgio_header */
enum { enum {
NFS_IOHDR_ERROR = 0, NFS_IOHDR_ERROR = 0,
...@@ -1293,29 +1279,29 @@ struct nfs_pgio_header { ...@@ -1293,29 +1279,29 @@ struct nfs_pgio_header {
unsigned long flags; unsigned long flags;
}; };
struct nfs_read_header { struct nfs_pgio_data {
struct nfs_pgio_header header;
struct nfs_read_data rpc_data;
};
struct nfs_write_data {
struct nfs_pgio_header *header; struct nfs_pgio_header *header;
struct list_head list; struct list_head list;
struct rpc_task task; struct rpc_task task;
struct nfs_fattr fattr; struct nfs_fattr fattr;
struct nfs_writeverf verf; struct nfs_writeverf verf; /* Used for writes */
struct nfs_pgio_args args; /* argument struct */ struct nfs_pgio_args args; /* argument struct */
struct nfs_pgio_res res; /* result struct */ struct nfs_pgio_res res; /* result struct */
unsigned long timestamp; /* For lease renewal */ unsigned long timestamp; /* For lease renewal */
int (*write_done_cb) (struct rpc_task *task, struct nfs_write_data *data); int (*pgio_done_cb) (struct rpc_task *task, struct nfs_pgio_data *data);
__u64 mds_offset; /* Filelayout dense stripe */ __u64 mds_offset; /* Filelayout dense stripe */
struct nfs_page_array pages; struct nfs_page_array pages;
struct nfs_client *ds_clp; /* pNFS data server */ struct nfs_client *ds_clp; /* pNFS data server */
}; };
struct nfs_read_header {
struct nfs_pgio_header header;
struct nfs_pgio_data rpc_data;
};
struct nfs_write_header { struct nfs_write_header {
struct nfs_pgio_header header; struct nfs_pgio_header header;
struct nfs_write_data rpc_data; struct nfs_pgio_data rpc_data;
struct nfs_writeverf verf; struct nfs_writeverf verf;
}; };
...@@ -1448,12 +1434,12 @@ struct nfs_rpc_ops { ...@@ -1448,12 +1434,12 @@ struct nfs_rpc_ops {
struct nfs_pathconf *); struct nfs_pathconf *);
int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int);
void (*read_setup) (struct nfs_read_data *, struct rpc_message *); void (*read_setup) (struct nfs_pgio_data *, struct rpc_message *);
int (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); int (*read_rpc_prepare)(struct rpc_task *, struct nfs_pgio_data *);
int (*read_done) (struct rpc_task *, struct nfs_read_data *); int (*read_done) (struct rpc_task *, struct nfs_pgio_data *);
void (*write_setup) (struct nfs_write_data *, struct rpc_message *); void (*write_setup) (struct nfs_pgio_data *, struct rpc_message *);
int (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); int (*write_rpc_prepare)(struct rpc_task *, struct nfs_pgio_data *);
int (*write_done) (struct rpc_task *, struct nfs_write_data *); int (*write_done) (struct rpc_task *, struct nfs_pgio_data *);
void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *); void (*commit_setup) (struct nfs_commit_data *, struct rpc_message *);
void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *); void (*commit_rpc_prepare)(struct rpc_task *, struct nfs_commit_data *);
int (*commit_done) (struct rpc_task *, struct nfs_commit_data *); int (*commit_done) (struct rpc_task *, struct nfs_commit_data *);
......
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