Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 192322
b: refs/heads/master
c: 9bc4e3c
h: refs/heads/master
v: v3
  • Loading branch information
Chuck Lever authored and Trond Myklebust committed May 14, 2010
1 parent 1c6c5e9 commit f5e2ad0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 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: dfe52c0419b8324bacd69bd28aae77e2d6ee0379
refs/heads/master: 9bc4e3ca46e4eb9cb434de4175c6041d00bbdca3
26 changes: 20 additions & 6 deletions trunk/fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3163,23 +3163,31 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa
msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT];
}

struct nfs4_renewdata {
struct nfs_client *client;
unsigned long timestamp;
};

/*
* nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special
* standalone procedure for queueing an asynchronous RENEW.
*/
static void nfs4_renew_release(void *data)
static void nfs4_renew_release(void *calldata)
{
struct nfs_client *clp = data;
struct nfs4_renewdata *data = calldata;
struct nfs_client *clp = data->client;

if (atomic_read(&clp->cl_count) > 1)
nfs4_schedule_state_renewal(clp);
nfs_put_client(clp);
kfree(data);
}

static void nfs4_renew_done(struct rpc_task *task, void *data)
static void nfs4_renew_done(struct rpc_task *task, void *calldata)
{
struct nfs_client *clp = data;
unsigned long timestamp = task->tk_start;
struct nfs4_renewdata *data = calldata;
struct nfs_client *clp = data->client;
unsigned long timestamp = data->timestamp;

if (task->tk_status < 0) {
/* Unless we're shutting down, schedule state recovery! */
Expand All @@ -3205,11 +3213,17 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred)
.rpc_argp = clp,
.rpc_cred = cred,
};
struct nfs4_renewdata *data;

if (!atomic_inc_not_zero(&clp->cl_count))
return -EIO;
data = kmalloc(sizeof(*data), GFP_KERNEL);
if (data == NULL)
return -ENOMEM;
data->client = clp;
data->timestamp = jiffies;
return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT,
&nfs4_renew_ops, clp);
&nfs4_renew_ops, data);
}

int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred)
Expand Down

0 comments on commit f5e2ad0

Please sign in to comment.