aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs3proc.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/nfs3proc.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/nfs3proc.c')
-rw-r--r--fs/nfs/nfs3proc.c41
1 files changed, 6 insertions, 35 deletions
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 4cdc2361a669..e68580ebaa47 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -732,16 +732,9 @@ static int nfs3_read_done(struct rpc_task *task, struct nfs_read_data *data)
732 return 0; 732 return 0;
733} 733}
734 734
735static void nfs3_proc_read_setup(struct nfs_read_data *data) 735static void nfs3_proc_read_setup(struct nfs_read_data *data, struct rpc_message *msg)
736{ 736{
737 struct rpc_message msg = { 737 msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ];
738 .rpc_proc = &nfs3_procedures[NFS3PROC_READ],
739 .rpc_argp = &data->args,
740 .rpc_resp = &data->res,
741 .rpc_cred = data->cred,
742 };
743
744 rpc_call_setup(&data->task, &msg, 0);
745} 738}
746 739
747static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) 740static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -753,24 +746,9 @@ static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data)
753 return 0; 746 return 0;
754} 747}
755 748
756static void nfs3_proc_write_setup(struct nfs_write_data *data, int how) 749static void nfs3_proc_write_setup(struct nfs_write_data *data, struct rpc_message *msg)
757{ 750{
758 struct rpc_message msg = { 751 msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE];
759 .rpc_proc = &nfs3_procedures[NFS3PROC_WRITE],
760 .rpc_argp = &data->args,
761 .rpc_resp = &data->res,
762 .rpc_cred = data->cred,
763 };
764
765 data->args.stable = NFS_UNSTABLE;
766 if (how & FLUSH_STABLE) {
767 data->args.stable = NFS_FILE_SYNC;
768 if (NFS_I(data->inode)->ncommit)
769 data->args.stable = NFS_DATA_SYNC;
770 }
771
772 /* Finalize the task. */
773 rpc_call_setup(&data->task, &msg, 0);
774} 752}
775 753
776static int nfs3_commit_done(struct rpc_task *task, struct nfs_write_data *data) 754static int nfs3_commit_done(struct rpc_task *task, struct nfs_write_data *data)
@@ -781,16 +759,9 @@ static int nfs3_commit_done(struct rpc_task *task, struct nfs_write_data *data)
781 return 0; 759 return 0;
782} 760}
783 761
784static void nfs3_proc_commit_setup(struct nfs_write_data *data, int how) 762static void nfs3_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
785{ 763{
786 struct rpc_message msg = { 764 msg->rpc_proc = &nfs3_procedures[NFS3PROC_COMMIT];
787 .rpc_proc = &nfs3_procedures[NFS3PROC_COMMIT],
788 .rpc_argp = &data->args,
789 .rpc_resp = &data->res,
790 .rpc_cred = data->cred,
791 };
792
793 rpc_call_setup(&data->task, &msg, 0);
794} 765}
795 766
796static int 767static int