diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-03-19 14:54:40 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-21 09:31:45 -0400 |
commit | ea7c330362257c072791aeaf03bae2cebf9fb984 (patch) | |
tree | 5633ea3278a8ad9b81891bd1fd149af76ad3fe7d | |
parent | c6cb80d00be42f30716ec817b963bcec094433b5 (diff) |
NFS: Remove nfs4_setup_sequence from generic read 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>
-rw-r--r-- | fs/nfs/direct.c | 2 | ||||
-rw-r--r-- | fs/nfs/nfs3proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/nfs4proc.c | 11 | ||||
-rw-r--r-- | fs/nfs/proc.c | 6 | ||||
-rw-r--r-- | fs/nfs/read.c | 13 | ||||
-rw-r--r-- | include/linux/nfs_xdr.h | 1 |
6 files changed, 25 insertions, 14 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index c4bdaf15289..9c7f66ac6cc 100644 --- a/fs/nfs/direct.c +++ b/fs/nfs/direct.c | |||
@@ -265,9 +265,7 @@ static void nfs_direct_read_release(void *calldata) | |||
265 | } | 265 | } |
266 | 266 | ||
267 | static const struct rpc_call_ops nfs_read_direct_ops = { | 267 | static const struct rpc_call_ops nfs_read_direct_ops = { |
268 | #if defined(CONFIG_NFS_V4_1) | ||
269 | .rpc_call_prepare = nfs_read_prepare, | 268 | .rpc_call_prepare = nfs_read_prepare, |
270 | #endif /* CONFIG_NFS_V4_1 */ | ||
271 | .rpc_call_done = nfs_direct_read_result, | 269 | .rpc_call_done = nfs_direct_read_result, |
272 | .rpc_release = nfs_direct_read_release, | 270 | .rpc_release = nfs_direct_read_release, |
273 | }; | 271 | }; |
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index 3bcf722800f..9d9b239329d 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c | |||
@@ -814,6 +814,11 @@ static void nfs3_proc_read_setup(struct nfs_read_data *data, struct rpc_message | |||
814 | msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ]; | 814 | msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ]; |
815 | } | 815 | } |
816 | 816 | ||
817 | static void nfs3_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) | ||
818 | { | ||
819 | rpc_call_start(task); | ||
820 | } | ||
821 | |||
817 | static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) | 822 | static int nfs3_write_done(struct rpc_task *task, struct nfs_write_data *data) |
818 | { | 823 | { |
819 | if (nfs3_async_handle_jukebox(task, data->inode)) | 824 | if (nfs3_async_handle_jukebox(task, data->inode)) |
@@ -884,6 +889,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = { | |||
884 | .pathconf = nfs3_proc_pathconf, | 889 | .pathconf = nfs3_proc_pathconf, |
885 | .decode_dirent = nfs3_decode_dirent, | 890 | .decode_dirent = nfs3_decode_dirent, |
886 | .read_setup = nfs3_proc_read_setup, | 891 | .read_setup = nfs3_proc_read_setup, |
892 | .read_rpc_prepare = nfs3_proc_read_rpc_prepare, | ||
887 | .read_done = nfs3_read_done, | 893 | .read_done = nfs3_read_done, |
888 | .write_setup = nfs3_proc_write_setup, | 894 | .write_setup = nfs3_proc_write_setup, |
889 | .write_rpc_prepare = nfs3_proc_write_rpc_prepare, | 895 | .write_rpc_prepare = nfs3_proc_write_rpc_prepare, |
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index dc910691acc..915385fcf53 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3299,6 +3299,16 @@ static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message | |||
3299 | nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 0); | 3299 | nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 0); |
3300 | } | 3300 | } |
3301 | 3301 | ||
3302 | static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) | ||
3303 | { | ||
3304 | if (nfs4_setup_sequence(NFS_SERVER(data->inode), | ||
3305 | &data->args.seq_args, | ||
3306 | &data->res.seq_res, | ||
3307 | task)) | ||
3308 | return; | ||
3309 | rpc_call_start(task); | ||
3310 | } | ||
3311 | |||
3302 | /* Reset the the nfs_read_data to send the read to the MDS. */ | 3312 | /* Reset the the nfs_read_data to send the read to the MDS. */ |
3303 | void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) | 3313 | void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) |
3304 | { | 3314 | { |
@@ -6457,6 +6467,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { | |||
6457 | .set_capabilities = nfs4_server_capabilities, | 6467 | .set_capabilities = nfs4_server_capabilities, |
6458 | .decode_dirent = nfs4_decode_dirent, | 6468 | .decode_dirent = nfs4_decode_dirent, |
6459 | .read_setup = nfs4_proc_read_setup, | 6469 | .read_setup = nfs4_proc_read_setup, |
6470 | .read_rpc_prepare = nfs4_proc_read_rpc_prepare, | ||
6460 | .read_done = nfs4_read_done, | 6471 | .read_done = nfs4_read_done, |
6461 | .write_setup = nfs4_proc_write_setup, | 6472 | .write_setup = nfs4_proc_write_setup, |
6462 | .write_rpc_prepare = nfs4_proc_write_rpc_prepare, | 6473 | .write_rpc_prepare = nfs4_proc_write_rpc_prepare, |
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index 8069b41e7f2..a8df70742d0 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c | |||
@@ -651,6 +651,11 @@ static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message * | |||
651 | msg->rpc_proc = &nfs_procedures[NFSPROC_READ]; | 651 | msg->rpc_proc = &nfs_procedures[NFSPROC_READ]; |
652 | } | 652 | } |
653 | 653 | ||
654 | static void nfs_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data) | ||
655 | { | ||
656 | rpc_call_start(task); | ||
657 | } | ||
658 | |||
654 | static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) | 659 | static int nfs_write_done(struct rpc_task *task, struct nfs_write_data *data) |
655 | { | 660 | { |
656 | if (nfs_async_handle_expired_key(task)) | 661 | if (nfs_async_handle_expired_key(task)) |
@@ -741,6 +746,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = { | |||
741 | .pathconf = nfs_proc_pathconf, | 746 | .pathconf = nfs_proc_pathconf, |
742 | .decode_dirent = nfs2_decode_dirent, | 747 | .decode_dirent = nfs2_decode_dirent, |
743 | .read_setup = nfs_proc_read_setup, | 748 | .read_setup = nfs_proc_read_setup, |
749 | .read_rpc_prepare = nfs_proc_read_rpc_prepare, | ||
744 | .read_done = nfs_read_done, | 750 | .read_done = nfs_read_done, |
745 | .write_setup = nfs_proc_write_setup, | 751 | .write_setup = nfs_proc_write_setup, |
746 | .write_rpc_prepare = nfs_proc_write_rpc_prepare, | 752 | .write_rpc_prepare = nfs_proc_write_rpc_prepare, |
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index 2662c0298dd..cc1f758a7ee 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
@@ -464,23 +464,14 @@ static void nfs_readpage_release_partial(void *calldata) | |||
464 | nfs_readdata_release(calldata); | 464 | nfs_readdata_release(calldata); |
465 | } | 465 | } |
466 | 466 | ||
467 | #if defined(CONFIG_NFS_V4_1) | ||
468 | void nfs_read_prepare(struct rpc_task *task, void *calldata) | 467 | void nfs_read_prepare(struct rpc_task *task, void *calldata) |
469 | { | 468 | { |
470 | struct nfs_read_data *data = calldata; | 469 | struct nfs_read_data *data = calldata; |
471 | 470 | NFS_PROTO(data->inode)->read_rpc_prepare(task, data); | |
472 | if (nfs4_setup_sequence(NFS_SERVER(data->inode), | ||
473 | &data->args.seq_args, &data->res.seq_res, | ||
474 | task)) | ||
475 | return; | ||
476 | rpc_call_start(task); | ||
477 | } | 471 | } |
478 | #endif /* CONFIG_NFS_V4_1 */ | ||
479 | 472 | ||
480 | static const struct rpc_call_ops nfs_read_partial_ops = { | 473 | static const struct rpc_call_ops nfs_read_partial_ops = { |
481 | #if defined(CONFIG_NFS_V4_1) | ||
482 | .rpc_call_prepare = nfs_read_prepare, | 474 | .rpc_call_prepare = nfs_read_prepare, |
483 | #endif /* CONFIG_NFS_V4_1 */ | ||
484 | .rpc_call_done = nfs_readpage_result_partial, | 475 | .rpc_call_done = nfs_readpage_result_partial, |
485 | .rpc_release = nfs_readpage_release_partial, | 476 | .rpc_release = nfs_readpage_release_partial, |
486 | }; | 477 | }; |
@@ -544,9 +535,7 @@ static void nfs_readpage_release_full(void *calldata) | |||
544 | } | 535 | } |
545 | 536 | ||
546 | static const struct rpc_call_ops nfs_read_full_ops = { | 537 | static const struct rpc_call_ops nfs_read_full_ops = { |
547 | #if defined(CONFIG_NFS_V4_1) | ||
548 | .rpc_call_prepare = nfs_read_prepare, | 538 | .rpc_call_prepare = nfs_read_prepare, |
549 | #endif /* CONFIG_NFS_V4_1 */ | ||
550 | .rpc_call_done = nfs_readpage_result_full, | 539 | .rpc_call_done = nfs_readpage_result_full, |
551 | .rpc_release = nfs_readpage_release_full, | 540 | .rpc_release = nfs_readpage_release_full, |
552 | }; | 541 | }; |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index b02a5f9eb21..286d74dde05 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -1244,6 +1244,7 @@ struct nfs_rpc_ops { | |||
1244 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); | 1244 | int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); |
1245 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); | 1245 | int (*decode_dirent)(struct xdr_stream *, struct nfs_entry *, int); |
1246 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); | 1246 | void (*read_setup) (struct nfs_read_data *, struct rpc_message *); |
1247 | void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *); | ||
1247 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); | 1248 | int (*read_done) (struct rpc_task *, struct nfs_read_data *); |
1248 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); | 1249 | void (*write_setup) (struct nfs_write_data *, struct rpc_message *); |
1249 | void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); | 1250 | void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); |