Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 206382
b: refs/heads/master
c: 71ac6da
h: refs/heads/master
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jun 22, 2010
1 parent 40b7f8f commit 652418e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa5190d0ed7d042c6d7d89fe8101558a912eee73
refs/heads/master: 71ac6da9944e2c9ec73ca64ca7bca74428858585
68 changes: 44 additions & 24 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -5048,24 +5048,6 @@ int nfs4_init_session(struct nfs_server *server)
/*
* Renew the cl_session lease.
*/
static int nfs4_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
{
struct nfs4_sequence_args args;
struct nfs4_sequence_res res;

struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE],
.rpc_argp = &args,
.rpc_resp = &res,
.rpc_cred = cred,
};

args.sa_cache_this = 0;

return nfs4_call_sync_sequence(clp, clp->cl_rpcclient, &msg, &args,
&res, args.sa_cache_this, 1);
}

struct nfs4_sequence_data {
struct nfs_client *clp;
struct nfs4_sequence_args args;
Expand Down Expand Up @@ -5139,29 +5121,67 @@ static const struct rpc_call_ops nfs41_sequence_ops = {
.rpc_release = nfs41_sequence_release,
};

static int nfs41_proc_async_sequence(struct nfs_client *clp,
struct rpc_cred *cred)
static struct rpc_task *_nfs41_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
{
struct nfs4_sequence_data *calldata;
struct rpc_message msg = {
.rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE],
.rpc_cred = cred,
};
struct rpc_task_setup task_setup_data = {
.rpc_client = clp->cl_rpcclient,
.rpc_message = &msg,
.callback_ops = &nfs41_sequence_ops,
.flags = RPC_TASK_ASYNC | RPC_TASK_SOFT,
};

if (!atomic_inc_not_zero(&clp->cl_count))
return -EIO;
return ERR_PTR(-EIO);
calldata = kmalloc(sizeof(*calldata), GFP_NOFS);
if (calldata == NULL) {
nfs_put_client(clp);
return -ENOMEM;
return ERR_PTR(-ENOMEM);
}
calldata->res.sr_slotid = NFS4_MAX_SLOT_TABLE;
msg.rpc_argp = &calldata->args;
msg.rpc_resp = &calldata->res;
calldata->clp = clp;
task_setup_data.callback_data = calldata;

return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT,
&nfs41_sequence_ops, calldata);
return rpc_run_task(&task_setup_data);
}

static int nfs41_proc_async_sequence(struct nfs_client *clp, struct rpc_cred *cred)
{
struct rpc_task *task;
int ret = 0;

task = _nfs41_proc_sequence(clp, cred);
if (IS_ERR(task))
ret = PTR_ERR(task);
else
rpc_put_task(task);
dprintk("<-- %s status=%d\n", __func__, ret);
return ret;
}

static int nfs4_proc_sequence(struct nfs_client *clp, struct rpc_cred *cred)
{
struct rpc_task *task;
int ret;

task = _nfs41_proc_sequence(clp, cred);
if (IS_ERR(task)) {
ret = PTR_ERR(task);
goto out;
}
ret = rpc_wait_for_completion_task(task);
if (!ret)
ret = task->tk_status;
rpc_put_task(task);
out:
dprintk("<-- %s status=%d\n", __func__, ret);
return ret;
}

struct nfs4_reclaim_complete_data {
Expand Down

0 comments on commit 652418e

Please sign in to comment.