aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorBryan Schumaker <bjschuma@netapp.com>2012-03-19 14:54:39 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-21 09:31:45 -0400
commitc6cb80d00be42f30716ec817b963bcec094433b5 (patch)
tree8049071fc2c5f01a730eb47bfa95ee095ce677df /fs/nfs
parent6f00866ddd15724eb20eac4ddf6e2c6c1a6cfcdc (diff)
NFS: Remove nfs4_setup_sequence from generic write code
This is an NFS v4 specific operation, so it belongs in the NFS v4 code and not the generic client. Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/direct.c4
-rw-r--r--fs/nfs/nfs3proc.c6
-rw-r--r--fs/nfs/nfs4proc.c11
-rw-r--r--fs/nfs/proc.c6
-rw-r--r--fs/nfs/write.c15
5 files changed, 24 insertions, 18 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index 1940f1a56a5f..c4bdaf15289a 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -554,9 +554,7 @@ static void nfs_direct_commit_release(void *calldata)
554} 554}
555 555
556static const struct rpc_call_ops nfs_commit_direct_ops = { 556static const struct rpc_call_ops nfs_commit_direct_ops = {
557#if defined(CONFIG_NFS_V4_1)
558 .rpc_call_prepare = nfs_write_prepare, 557 .rpc_call_prepare = nfs_write_prepare,
559#endif /* CONFIG_NFS_V4_1 */
560 .rpc_call_done = nfs_direct_commit_result, 558 .rpc_call_done = nfs_direct_commit_result,
561 .rpc_release = nfs_direct_commit_release, 559 .rpc_release = nfs_direct_commit_release,
562}; 560};
@@ -696,9 +694,7 @@ out_unlock:
696} 694}
697 695
698static const struct rpc_call_ops nfs_write_direct_ops = { 696static const struct rpc_call_ops nfs_write_direct_ops = {
699#if defined(CONFIG_NFS_V4_1)
700 .rpc_call_prepare = nfs_write_prepare, 697 .rpc_call_prepare = nfs_write_prepare,
701#endif /* CONFIG_NFS_V4_1 */
702 .rpc_call_done = nfs_direct_write_result, 698 .rpc_call_done = nfs_direct_write_result,
703 .rpc_release = nfs_direct_write_release, 699 .rpc_release = nfs_direct_write_release,
704}; 700};
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index 91943953a370..3bcf722800f3 100644
--- a/fs/nfs/nfs3proc.c
+++ b/fs/nfs/nfs3proc.c
@@ -828,6 +828,11 @@ static void nfs3_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
828 msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE]; 828 msg->rpc_proc = &nfs3_procedures[NFS3PROC_WRITE];
829} 829}
830 830
831static void nfs3_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data)
832{
833 rpc_call_start(task);
834}
835
831static int nfs3_commit_done(struct rpc_task *task, struct nfs_write_data *data) 836static int nfs3_commit_done(struct rpc_task *task, struct nfs_write_data *data)
832{ 837{
833 if (nfs3_async_handle_jukebox(task, data->inode)) 838 if (nfs3_async_handle_jukebox(task, data->inode))
@@ -881,6 +886,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
881 .read_setup = nfs3_proc_read_setup, 886 .read_setup = nfs3_proc_read_setup,
882 .read_done = nfs3_read_done, 887 .read_done = nfs3_read_done,
883 .write_setup = nfs3_proc_write_setup, 888 .write_setup = nfs3_proc_write_setup,
889 .write_rpc_prepare = nfs3_proc_write_rpc_prepare,
884 .write_done = nfs3_write_done, 890 .write_done = nfs3_write_done,
885 .commit_setup = nfs3_proc_commit_setup, 891 .commit_setup = nfs3_proc_commit_setup,
886 .commit_done = nfs3_commit_done, 892 .commit_done = nfs3_commit_done,
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index d41d97fb4cb9..dc910691acc0 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3373,6 +3373,16 @@ static void nfs4_proc_write_setup(struct nfs_write_data *data, struct rpc_messag
3373 nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 1); 3373 nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 1);
3374} 3374}
3375 3375
3376static void nfs4_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data)
3377{
3378 if (nfs4_setup_sequence(NFS_SERVER(data->inode),
3379 &data->args.seq_args,
3380 &data->res.seq_res,
3381 task))
3382 return;
3383 rpc_call_start(task);
3384}
3385
3376static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *data) 3386static int nfs4_commit_done_cb(struct rpc_task *task, struct nfs_write_data *data)
3377{ 3387{
3378 struct inode *inode = data->inode; 3388 struct inode *inode = data->inode;
@@ -6449,6 +6459,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
6449 .read_setup = nfs4_proc_read_setup, 6459 .read_setup = nfs4_proc_read_setup,
6450 .read_done = nfs4_read_done, 6460 .read_done = nfs4_read_done,
6451 .write_setup = nfs4_proc_write_setup, 6461 .write_setup = nfs4_proc_write_setup,
6462 .write_rpc_prepare = nfs4_proc_write_rpc_prepare,
6452 .write_done = nfs4_write_done, 6463 .write_done = nfs4_write_done,
6453 .commit_setup = nfs4_proc_commit_setup, 6464 .commit_setup = nfs4_proc_commit_setup,
6454 .commit_done = nfs4_commit_done, 6465 .commit_done = nfs4_commit_done,
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index 0c672588fe5a..8069b41e7f2d 100644
--- a/fs/nfs/proc.c
+++ b/fs/nfs/proc.c
@@ -668,6 +668,11 @@ static void nfs_proc_write_setup(struct nfs_write_data *data, struct rpc_message
668 msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE]; 668 msg->rpc_proc = &nfs_procedures[NFSPROC_WRITE];
669} 669}
670 670
671static void nfs_proc_write_rpc_prepare(struct rpc_task *task, struct nfs_write_data *data)
672{
673 rpc_call_start(task);
674}
675
671static void 676static void
672nfs_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg) 677nfs_proc_commit_setup(struct nfs_write_data *data, struct rpc_message *msg)
673{ 678{
@@ -738,6 +743,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
738 .read_setup = nfs_proc_read_setup, 743 .read_setup = nfs_proc_read_setup,
739 .read_done = nfs_read_done, 744 .read_done = nfs_read_done,
740 .write_setup = nfs_proc_write_setup, 745 .write_setup = nfs_proc_write_setup,
746 .write_rpc_prepare = nfs_proc_write_rpc_prepare,
741 .write_done = nfs_write_done, 747 .write_done = nfs_write_done,
742 .commit_setup = nfs_proc_commit_setup, 748 .commit_setup = nfs_proc_commit_setup,
743 .lock = nfs_proc_lock, 749 .lock = nfs_proc_lock,
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index bd93d40099f9..2c68818f68ac 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -1172,23 +1172,14 @@ out:
1172 nfs_writedata_release(calldata); 1172 nfs_writedata_release(calldata);
1173} 1173}
1174 1174
1175#if defined(CONFIG_NFS_V4_1)
1176void nfs_write_prepare(struct rpc_task *task, void *calldata) 1175void nfs_write_prepare(struct rpc_task *task, void *calldata)
1177{ 1176{
1178 struct nfs_write_data *data = calldata; 1177 struct nfs_write_data *data = calldata;
1179 1178 NFS_PROTO(data->inode)->write_rpc_prepare(task, data);
1180 if (nfs4_setup_sequence(NFS_SERVER(data->inode),
1181 &data->args.seq_args,
1182 &data->res.seq_res, task))
1183 return;
1184 rpc_call_start(task);
1185} 1179}
1186#endif /* CONFIG_NFS_V4_1 */
1187 1180
1188static const struct rpc_call_ops nfs_write_partial_ops = { 1181static const struct rpc_call_ops nfs_write_partial_ops = {
1189#if defined(CONFIG_NFS_V4_1)
1190 .rpc_call_prepare = nfs_write_prepare, 1182 .rpc_call_prepare = nfs_write_prepare,
1191#endif /* CONFIG_NFS_V4_1 */
1192 .rpc_call_done = nfs_writeback_done_partial, 1183 .rpc_call_done = nfs_writeback_done_partial,
1193 .rpc_release = nfs_writeback_release_partial, 1184 .rpc_release = nfs_writeback_release_partial,
1194}; 1185};
@@ -1250,9 +1241,7 @@ remove_request:
1250} 1241}
1251 1242
1252static const struct rpc_call_ops nfs_write_full_ops = { 1243static const struct rpc_call_ops nfs_write_full_ops = {
1253#if defined(CONFIG_NFS_V4_1)
1254 .rpc_call_prepare = nfs_write_prepare, 1244 .rpc_call_prepare = nfs_write_prepare,
1255#endif /* CONFIG_NFS_V4_1 */
1256 .rpc_call_done = nfs_writeback_done_full, 1245 .rpc_call_done = nfs_writeback_done_full,
1257 .rpc_release = nfs_writeback_release_full, 1246 .rpc_release = nfs_writeback_release_full,
1258}; 1247};
@@ -1544,9 +1533,7 @@ static void nfs_commit_release(void *calldata)
1544} 1533}
1545 1534
1546static const struct rpc_call_ops nfs_commit_ops = { 1535static const struct rpc_call_ops nfs_commit_ops = {
1547#if defined(CONFIG_NFS_V4_1)
1548 .rpc_call_prepare = nfs_write_prepare, 1536 .rpc_call_prepare = nfs_write_prepare,
1549#endif /* CONFIG_NFS_V4_1 */
1550 .rpc_call_done = nfs_commit_done, 1537 .rpc_call_done = nfs_commit_done,
1551 .rpc_release = nfs_commit_release, 1538 .rpc_release = nfs_commit_release,
1552}; 1539};