diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/nfs4proc.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 04f4b2b2506b..9998c2958103 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
@@ -3163,23 +3163,31 @@ static void nfs4_proc_commit_setup(struct nfs_write_data *data, struct rpc_messa | |||
3163 | msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; | 3163 | msg->rpc_proc = &nfs4_procedures[NFSPROC4_CLNT_COMMIT]; |
3164 | } | 3164 | } |
3165 | 3165 | ||
3166 | struct nfs4_renewdata { | ||
3167 | struct nfs_client *client; | ||
3168 | unsigned long timestamp; | ||
3169 | }; | ||
3170 | |||
3166 | /* | 3171 | /* |
3167 | * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special | 3172 | * nfs4_proc_async_renew(): This is not one of the nfs_rpc_ops; it is a special |
3168 | * standalone procedure for queueing an asynchronous RENEW. | 3173 | * standalone procedure for queueing an asynchronous RENEW. |
3169 | */ | 3174 | */ |
3170 | static void nfs4_renew_release(void *data) | 3175 | static void nfs4_renew_release(void *calldata) |
3171 | { | 3176 | { |
3172 | struct nfs_client *clp = data; | 3177 | struct nfs4_renewdata *data = calldata; |
3178 | struct nfs_client *clp = data->client; | ||
3173 | 3179 | ||
3174 | if (atomic_read(&clp->cl_count) > 1) | 3180 | if (atomic_read(&clp->cl_count) > 1) |
3175 | nfs4_schedule_state_renewal(clp); | 3181 | nfs4_schedule_state_renewal(clp); |
3176 | nfs_put_client(clp); | 3182 | nfs_put_client(clp); |
3183 | kfree(data); | ||
3177 | } | 3184 | } |
3178 | 3185 | ||
3179 | static void nfs4_renew_done(struct rpc_task *task, void *data) | 3186 | static void nfs4_renew_done(struct rpc_task *task, void *calldata) |
3180 | { | 3187 | { |
3181 | struct nfs_client *clp = data; | 3188 | struct nfs4_renewdata *data = calldata; |
3182 | unsigned long timestamp = task->tk_start; | 3189 | struct nfs_client *clp = data->client; |
3190 | unsigned long timestamp = data->timestamp; | ||
3183 | 3191 | ||
3184 | if (task->tk_status < 0) { | 3192 | if (task->tk_status < 0) { |
3185 | /* Unless we're shutting down, schedule state recovery! */ | 3193 | /* Unless we're shutting down, schedule state recovery! */ |
@@ -3205,11 +3213,17 @@ int nfs4_proc_async_renew(struct nfs_client *clp, struct rpc_cred *cred) | |||
3205 | .rpc_argp = clp, | 3213 | .rpc_argp = clp, |
3206 | .rpc_cred = cred, | 3214 | .rpc_cred = cred, |
3207 | }; | 3215 | }; |
3216 | struct nfs4_renewdata *data; | ||
3208 | 3217 | ||
3209 | if (!atomic_inc_not_zero(&clp->cl_count)) | 3218 | if (!atomic_inc_not_zero(&clp->cl_count)) |
3210 | return -EIO; | 3219 | return -EIO; |
3220 | data = kmalloc(sizeof(*data), GFP_KERNEL); | ||
3221 | if (data == NULL) | ||
3222 | return -ENOMEM; | ||
3223 | data->client = clp; | ||
3224 | data->timestamp = jiffies; | ||
3211 | return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT, | 3225 | return rpc_call_async(clp->cl_rpcclient, &msg, RPC_TASK_SOFT, |
3212 | &nfs4_renew_ops, clp); | 3226 | &nfs4_renew_ops, data); |
3213 | } | 3227 | } |
3214 | 3228 | ||
3215 | int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred) | 3229 | int nfs4_proc_renew(struct nfs_client *clp, struct rpc_cred *cred) |