nfs41: sunrpc: Export the call prepare state for session reset
authorAndy Adamson <andros@netapp.com>
Wed, 1 Apr 2009 13:22:40 +0000 (09:22 -0400)
committerBenny Halevy <bhalevy@panasas.com>
Wed, 17 Jun 2009 19:25:07 +0000 (12:25 -0700)
Signed-off-by: Andy Adamson<andros@netapp.com>
Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
include/linux/sunrpc/clnt.h
include/linux/sunrpc/sched.h
net/sunrpc/clnt.c
net/sunrpc/sched.c

index c39a21040dcb64aabce55d51db9a56d52f62c289..37881f1a0bd70af99e72302f408adfaf7b4cb30d 100644 (file)
@@ -143,6 +143,7 @@ int         rpc_call_sync(struct rpc_clnt *clnt,
                              const struct rpc_message *msg, int flags);
 struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
                               int flags);
+void           rpc_restart_call_prepare(struct rpc_task *);
 void           rpc_restart_call(struct rpc_task *);
 void           rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
 size_t         rpc_max_payload(struct rpc_clnt *);
index 64981a2f1cae12e1b9f384b758cbc1718ee09721..177376880fabcb15497c47aa60abd4a0fca3b5a9 100644 (file)
@@ -237,6 +237,7 @@ void                rpc_show_tasks(void);
 int            rpc_init_mempool(void);
 void           rpc_destroy_mempool(void);
 extern struct workqueue_struct *rpciod_workqueue;
+void           rpc_prepare_task(struct rpc_task *task);
 
 static inline void rpc_exit(struct rpc_task *task, int status)
 {
index 5abab094441f97cbe8dd7f91dcd554579030b6be..d00e8135f866a1df428e1b84ee94c5adc1fdecb3 100644 (file)
@@ -694,6 +694,19 @@ void rpc_force_rebind(struct rpc_clnt *clnt)
 }
 EXPORT_SYMBOL_GPL(rpc_force_rebind);
 
+/*
+ * Restart an (async) RPC call from the call_prepare state.
+ * Usually called from within the exit handler.
+ */
+void
+rpc_restart_call_prepare(struct rpc_task *task)
+{
+       if (RPC_ASSASSINATED(task))
+               return;
+       task->tk_action = rpc_prepare_task;
+}
+EXPORT_SYMBOL_GPL(rpc_restart_call_prepare);
+
 /*
  * Restart an (async) RPC call. Usually called from within the
  * exit handler.
index ff50a054686593b55a203d28ba8a8aa68c191260..1102ce1251f7b61ad7d6a70a7df8826ce2a420c2 100644 (file)
@@ -569,7 +569,7 @@ EXPORT_SYMBOL_GPL(rpc_delay);
 /*
  * Helper to call task->tk_ops->rpc_call_prepare
  */
-static void rpc_prepare_task(struct rpc_task *task)
+void rpc_prepare_task(struct rpc_task *task)
 {
        task->tk_ops->rpc_call_prepare(task, task->tk_calldata);
 }