Commit ea7c3303 authored by Bryan Schumaker's avatar Bryan Schumaker Committed by Trond Myklebust

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: default avatarBryan Schumaker <bjschuma@netapp.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent c6cb80d0
...@@ -265,9 +265,7 @@ static void nfs_direct_read_release(void *calldata) ...@@ -265,9 +265,7 @@ static void nfs_direct_read_release(void *calldata)
} }
static const struct rpc_call_ops nfs_read_direct_ops = { static const struct rpc_call_ops nfs_read_direct_ops = {
#if defined(CONFIG_NFS_V4_1)
.rpc_call_prepare = nfs_read_prepare, .rpc_call_prepare = nfs_read_prepare,
#endif /* CONFIG_NFS_V4_1 */
.rpc_call_done = nfs_direct_read_result, .rpc_call_done = nfs_direct_read_result,
.rpc_release = nfs_direct_read_release, .rpc_release = nfs_direct_read_release,
}; };
......
...@@ -814,6 +814,11 @@ static void nfs3_proc_read_setup(struct nfs_read_data *data, struct rpc_message ...@@ -814,6 +814,11 @@ static void nfs3_proc_read_setup(struct nfs_read_data *data, struct rpc_message
msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ]; msg->rpc_proc = &nfs3_procedures[NFS3PROC_READ];
} }
static void nfs3_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data)
{
rpc_call_start(task);
}
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_write_data *data)
{ {
if (nfs3_async_handle_jukebox(task, data->inode)) if (nfs3_async_handle_jukebox(task, data->inode))
...@@ -884,6 +889,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = { ...@@ -884,6 +889,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
.pathconf = nfs3_proc_pathconf, .pathconf = nfs3_proc_pathconf,
.decode_dirent = nfs3_decode_dirent, .decode_dirent = nfs3_decode_dirent,
.read_setup = nfs3_proc_read_setup, .read_setup = nfs3_proc_read_setup,
.read_rpc_prepare = nfs3_proc_read_rpc_prepare,
.read_done = nfs3_read_done, .read_done = nfs3_read_done,
.write_setup = nfs3_proc_write_setup, .write_setup = nfs3_proc_write_setup,
.write_rpc_prepare = nfs3_proc_write_rpc_prepare, .write_rpc_prepare = nfs3_proc_write_rpc_prepare,
......
...@@ -3299,6 +3299,16 @@ static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message ...@@ -3299,6 +3299,16 @@ static void nfs4_proc_read_setup(struct nfs_read_data *data, struct rpc_message
nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 0); nfs41_init_sequence(&data->args.seq_args, &data->res.seq_res, 0);
} }
static void nfs4_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data)
{
if (nfs4_setup_sequence(NFS_SERVER(data->inode),
&data->args.seq_args,
&data->res.seq_res,
task))
return;
rpc_call_start(task);
}
/* Reset the the nfs_read_data to send the read to the MDS. */ /* Reset the the nfs_read_data to send the read to the MDS. */
void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data) void nfs4_reset_read(struct rpc_task *task, struct nfs_read_data *data)
{ {
...@@ -6457,6 +6467,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = { ...@@ -6457,6 +6467,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
.set_capabilities = nfs4_server_capabilities, .set_capabilities = nfs4_server_capabilities,
.decode_dirent = nfs4_decode_dirent, .decode_dirent = nfs4_decode_dirent,
.read_setup = nfs4_proc_read_setup, .read_setup = nfs4_proc_read_setup,
.read_rpc_prepare = nfs4_proc_read_rpc_prepare,
.read_done = nfs4_read_done, .read_done = nfs4_read_done,
.write_setup = nfs4_proc_write_setup, .write_setup = nfs4_proc_write_setup,
.write_rpc_prepare = nfs4_proc_write_rpc_prepare, .write_rpc_prepare = nfs4_proc_write_rpc_prepare,
......
...@@ -651,6 +651,11 @@ static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message * ...@@ -651,6 +651,11 @@ static void nfs_proc_read_setup(struct nfs_read_data *data, struct rpc_message *
msg->rpc_proc = &nfs_procedures[NFSPROC_READ]; msg->rpc_proc = &nfs_procedures[NFSPROC_READ];
} }
static void nfs_proc_read_rpc_prepare(struct rpc_task *task, struct nfs_read_data *data)
{
rpc_call_start(task);
}
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_write_data *data)
{ {
if (nfs_async_handle_expired_key(task)) if (nfs_async_handle_expired_key(task))
...@@ -741,6 +746,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = { ...@@ -741,6 +746,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
.pathconf = nfs_proc_pathconf, .pathconf = nfs_proc_pathconf,
.decode_dirent = nfs2_decode_dirent, .decode_dirent = nfs2_decode_dirent,
.read_setup = nfs_proc_read_setup, .read_setup = nfs_proc_read_setup,
.read_rpc_prepare = nfs_proc_read_rpc_prepare,
.read_done = nfs_read_done, .read_done = nfs_read_done,
.write_setup = nfs_proc_write_setup, .write_setup = nfs_proc_write_setup,
.write_rpc_prepare = nfs_proc_write_rpc_prepare, .write_rpc_prepare = nfs_proc_write_rpc_prepare,
......
...@@ -464,23 +464,14 @@ static void nfs_readpage_release_partial(void *calldata) ...@@ -464,23 +464,14 @@ static void nfs_readpage_release_partial(void *calldata)
nfs_readdata_release(calldata); nfs_readdata_release(calldata);
} }
#if defined(CONFIG_NFS_V4_1)
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_read_data *data = calldata;
NFS_PROTO(data->inode)->read_rpc_prepare(task, data);
if (nfs4_setup_sequence(NFS_SERVER(data->inode),
&data->args.seq_args, &data->res.seq_res,
task))
return;
rpc_call_start(task);
} }
#endif /* CONFIG_NFS_V4_1 */
static const struct rpc_call_ops nfs_read_partial_ops = { static const struct rpc_call_ops nfs_read_partial_ops = {
#if defined(CONFIG_NFS_V4_1)
.rpc_call_prepare = nfs_read_prepare, .rpc_call_prepare = nfs_read_prepare,
#endif /* CONFIG_NFS_V4_1 */
.rpc_call_done = nfs_readpage_result_partial, .rpc_call_done = nfs_readpage_result_partial,
.rpc_release = nfs_readpage_release_partial, .rpc_release = nfs_readpage_release_partial,
}; };
...@@ -544,9 +535,7 @@ static void nfs_readpage_release_full(void *calldata) ...@@ -544,9 +535,7 @@ static void nfs_readpage_release_full(void *calldata)
} }
static const struct rpc_call_ops nfs_read_full_ops = { static const struct rpc_call_ops nfs_read_full_ops = {
#if defined(CONFIG_NFS_V4_1)
.rpc_call_prepare = nfs_read_prepare, .rpc_call_prepare = nfs_read_prepare,
#endif /* CONFIG_NFS_V4_1 */
.rpc_call_done = nfs_readpage_result_full, .rpc_call_done = nfs_readpage_result_full,
.rpc_release = nfs_readpage_release_full, .rpc_release = nfs_readpage_release_full,
}; };
......
...@@ -1244,6 +1244,7 @@ struct nfs_rpc_ops { ...@@ -1244,6 +1244,7 @@ struct nfs_rpc_ops {
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_read_data *, struct rpc_message *);
void (*read_rpc_prepare)(struct rpc_task *, struct nfs_read_data *);
int (*read_done) (struct rpc_task *, struct nfs_read_data *); int (*read_done) (struct rpc_task *, struct nfs_read_data *);
void (*write_setup) (struct nfs_write_data *, struct rpc_message *); void (*write_setup) (struct nfs_write_data *, struct rpc_message *);
void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_data *); void (*write_rpc_prepare)(struct rpc_task *, struct nfs_write_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