aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-07-14 15:40:00 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-01-30 02:05:32 -0500
commitbdc7f021f3a1fade77adf3c2d7f65690566fddfe (patch)
treec076431ac83fc75cde00dc3d3a218fabae449980 /fs/nfs/proc.c
parentb3ef8b3bb93300e58a4c4806207de3de4eb76f48 (diff)
NFS: Clean up the (commit|read|write)_setup() callback routines
Move the common code for setting up the nfs_write_data and nfs_read_data structures into fs/nfs/read.c, fs/nfs/write.c and fs/nfs/direct.c. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/proc.c')
-rw-r--r--fs/nfs/proc.c26
1 files changed, 5 insertions, 21 deletions
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 4f80d88e9fee..c9f46a24e75c 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -565,16 +565,9 @@ static int nfs_read_done(struct rpc_task *task, struct nfs_read_data *data)
565 return 0; 565 return 0;
566} 566}
567 567
568static void nfs_proc_read_setup(struct nfs_read_data *data) 568static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg)
569{ 569{
570 struct rpc_message msg = { 570 msg->rpc_proc = &nfs_procedures[NFSPROC_READ];
571 .rpc_proc = &nfs_procedures[NFSPROC_READ],
572 .rpc_argp = &data->args,
573 .rpc_resp = &data->res,
574 .rpc_cred = data->cred,
575 };
576
577 rpc_call_setup(&data->task, &msg, 0);
578} 571}
579 572
580static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) 573static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -584,24 +577,15 @@ static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data)
584 return 0; 577 return 0;
585} 578}
586 579
587static void nfs_proc_write_setup(struct nfs_write_data *data, int how) 580static void nfs_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
588{ 581{
589 struct rpc_message msg = {
590 .rpc_proc = &nfs_procedures[NFSPROC_WRITE],
591 .rpc_argp = &data->args,
592 .rpc_resp = &data->res,
593 .rpc_cred = data->cred,
594 };
595
596 /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */ 582 /* Note: NFSv2 ignores @stable and always uses NFS_FILE_SYNC */
597 data->args.stable = NFS_FILE_SYNC; 583 data->args.stable = NFS_FILE_SYNC;
598 584 msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE];
599 /* Finalize the task. */
600 rpc_call_setup(&data->task, &msg, 0);
601} 585}
602 586
603static void 587static void
604nfs_proc_commit_setup(struct nfs_write_data *data, int how) 588nfs_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
605{ 589{
606 BUG(); 590 BUG();
607} 591}