mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
nfs41 delegreturn sequence setup done support
Separate delegreturn calls from nfs41: sequence setup/done support Implement the delegreturn rpc_call_prepare method for asynchronuos nfs rpcs, call nfs41_setup_sequence from respective rpc_call_validate_args methods. Call nfs4_sequence_done from respective rpc_call_done methods. Note that we need to pass a pointer to the nfs_server in calls data for passing on to nfs4_sequence_done. Signed-off-by: Andy Adamson<andros@netapp.com> Signed-off-by: Benny Halevy <bhalevy@panasas.com> [pnfs: client data server write validate and release] Signed-off-by: Andy Adamson<andros@umich.edu> Signed-off-by: Benny Halevy <bhalevy@panasas.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
parent
21d9a851aa
commit
938e101091
1 changed files with 23 additions and 1 deletions
|
@ -3360,6 +3360,10 @@ struct nfs4_delegreturndata {
|
|||
static void nfs4_delegreturn_done(struct rpc_task *task, void *calldata)
|
||||
{
|
||||
struct nfs4_delegreturndata *data = calldata;
|
||||
|
||||
nfs4_sequence_done_free_slot(data->res.server, &data->res.seq_res,
|
||||
task->tk_status);
|
||||
|
||||
data->rpc_status = task->tk_status;
|
||||
if (data->rpc_status == 0)
|
||||
renew_lease(data->res.server, data->timestamp);
|
||||
|
@ -3370,7 +3374,25 @@ static void nfs4_delegreturn_release(void *calldata)
|
|||
kfree(calldata);
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NFS_V4_1)
|
||||
static void nfs4_delegreturn_prepare(struct rpc_task *task, void *data)
|
||||
{
|
||||
struct nfs4_delegreturndata *d_data;
|
||||
|
||||
d_data = (struct nfs4_delegreturndata *)data;
|
||||
|
||||
if (nfs4_setup_sequence(d_data->res.server->nfs_client,
|
||||
&d_data->args.seq_args,
|
||||
&d_data->res.seq_res, 1, task))
|
||||
return;
|
||||
rpc_call_start(task);
|
||||
}
|
||||
#endif /* CONFIG_NFS_V4_1 */
|
||||
|
||||
static const struct rpc_call_ops nfs4_delegreturn_ops = {
|
||||
#if defined(CONFIG_NFS_V4_1)
|
||||
.rpc_call_prepare = nfs4_delegreturn_prepare,
|
||||
#endif /* CONFIG_NFS_V4_1 */
|
||||
.rpc_call_done = nfs4_delegreturn_done,
|
||||
.rpc_release = nfs4_delegreturn_release,
|
||||
};
|
||||
|
@ -3392,7 +3414,7 @@ static int _nfs4_proc_delegreturn(struct inode *inode, struct rpc_cred *cred, co
|
|||
};
|
||||
int status = 0;
|
||||
|
||||
data = kmalloc(sizeof(*data), GFP_KERNEL);
|
||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||
if (data == NULL)
|
||||
return -ENOMEM;
|
||||
data->args.fhandle = &data->fh;
|
||||
|
|
Loading…
Reference in a new issue