Commit a486aeda authored by J. Bruce Fields's avatar J. Bruce Fields Committed by Trond Myklebust

rpc: minor cleanup of scheduler callback code

Try to make the comment here a little more clear and concise.

Also, this macro definition seems unnecessary.
Signed-off-by: default avatarJ. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent d25a03cf
...@@ -135,7 +135,6 @@ struct rpc_task_setup { ...@@ -135,7 +135,6 @@ struct rpc_task_setup {
#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
#define RPC_TASK_RUNNING 0 #define RPC_TASK_RUNNING 0
......
...@@ -626,19 +626,15 @@ static void __rpc_execute(struct rpc_task *task) ...@@ -626,19 +626,15 @@ static void __rpc_execute(struct rpc_task *task)
/* /*
* Execute any pending callback. * Execute any pending callback.
*/ */
if (RPC_DO_CALLBACK(task)) { if (task->tk_callback) {
/* Define a callback save pointer */
void (*save_callback)(struct rpc_task *); void (*save_callback)(struct rpc_task *);
/* /*
* If a callback exists, save it, reset it, * We set tk_callback to NULL before calling it,
* call it. * in case it sets the tk_callback field itself:
* The save is needed to stop from resetting
* another callback set within the callback handler
* - Dave
*/ */
save_callback=task->tk_callback; save_callback = task->tk_callback;
task->tk_callback=NULL; task->tk_callback = NULL;
save_callback(task); save_callback(task);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment