extern struct rpc_procinfo nfs3_procedures[];
extern __be32 *nfs3_decode_dirent(__be32 *, struct nfs_entry *, int);
-/* nfs4proc.c */
-static inline void nfs4_restart_rpc(struct rpc_task *task,
- const struct nfs_client *clp)
-{
-#ifdef CONFIG_NFS_V4_1
- if (nfs4_has_session(clp) &&
- test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)) {
- rpc_restart_call_prepare(task);
- return;
- }
-#endif /* CONFIG_NFS_V4_1 */
- rpc_restart_call(task);
-}
-
/* nfs4xdr.c */
#ifdef CONFIG_NFS_V4
extern __be32 *nfs4_decode_dirent(__be32 *p, struct nfs_entry *entry, int plus);
#endif
/* nfs4proc.c */
+extern void nfs4_restart_rpc(struct rpc_task *, const struct nfs_client *,
+ struct nfs4_sequence_res *);
#ifdef CONFIG_NFS_V4
extern struct rpc_procinfo nfs4_procedures[];
#endif
#endif /* CONFIG_NFS_V4_1 */
}
+void nfs4_restart_rpc(struct rpc_task *task, const struct nfs_client *clp,
+ struct nfs4_sequence_res *res)
+{
+#ifdef CONFIG_NFS_V4_1
+ if (nfs4_has_session(clp)) {
+ nfs41_sequence_free_slot(clp, res);
+ rpc_restart_call_prepare(task);
+ return;
+ }
+#endif /* CONFIG_NFS_V4_1 */
+ rpc_restart_call(task);
+}
+
/* no restart, therefore free slot here */
static void nfs4_sequence_done_free_slot(const struct nfs_server *server,
struct nfs4_sequence_res *res,
break;
default:
if (nfs4_async_handle_error(task, server, state) == -EAGAIN) {
- nfs4_restart_rpc(task, server->nfs_client);
+ nfs4_restart_rpc(task, server->nfs_client,
+ &calldata->res.seq_res);
return;
}
}
nfs4_sequence_done(server, &data->res.seq_res, task->tk_status);
if (nfs4_async_handle_error(task, server, data->args.context->state) == -EAGAIN) {
- nfs4_restart_rpc(task, server->nfs_client);
+ nfs4_restart_rpc(task, server->nfs_client, &data->res.seq_res);
return -EAGAIN;
}
task->tk_status);
if (nfs4_async_handle_error(task, NFS_SERVER(inode), data->args.context->state) == -EAGAIN) {
- nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
+ nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client,
+ &data->res.seq_res);
return -EAGAIN;
}
if (task->tk_status >= 0) {
nfs4_sequence_done(NFS_SERVER(inode), &data->res.seq_res,
task->tk_status);
if (nfs4_async_handle_error(task, NFS_SERVER(inode), NULL) == -EAGAIN) {
- nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client);
+ nfs4_restart_rpc(task, NFS_SERVER(inode)->nfs_client,
+ &data->res.seq_res);
return -EAGAIN;
}
nfs4_sequence_free_slot(NFS_SERVER(inode)->nfs_client,
default:
if (nfs4_async_handle_error(task, calldata->server, NULL) == -EAGAIN)
nfs4_restart_rpc(task,
- calldata->server->nfs_client);
+ calldata->server->nfs_client,
+ &calldata->res.seq_res);
}
nfs4_sequence_free_slot(calldata->server->nfs_client,
&calldata->res.seq_res);
if (_nfs4_async_handle_error(task, NULL, clp, NULL)
== -EAGAIN) {
- nfs4_restart_rpc(task, clp);
+ nfs4_restart_rpc(task, clp, task->tk_msg.rpc_resp);
return;
}
}