Commit a486aeda9b2b0d944aecce7871b3186379b898de

Authored by \\\"J. Bruce Fields\\\
Committed by Trond Myklebust
1 parent d25a03cf96

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: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>

Showing 2 changed files with 5 additions and 10 deletions Side-by-side Diff

include/linux/sunrpc/sched.h
... ... @@ -135,7 +135,6 @@
135 135 #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
136 136 #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
137 137 #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
138   -#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
139 138 #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
140 139  
141 140 #define RPC_TASK_RUNNING 0
... ... @@ -626,19 +626,15 @@
626 626 /*
627 627 * Execute any pending callback.
628 628 */
629   - if (RPC_DO_CALLBACK(task)) {
630   - /* Define a callback save pointer */
  629 + if (task->tk_callback) {
631 630 void (*save_callback)(struct rpc_task *);
632 631  
633 632 /*
634   - * If a callback exists, save it, reset it,
635   - * call it.
636   - * The save is needed to stop from resetting
637   - * another callback set within the callback handler
638   - * - Dave
  633 + * We set tk_callback to NULL before calling it,
  634 + * in case it sets the tk_callback field itself:
639 635 */
640   - save_callback=task->tk_callback;
641   - task->tk_callback=NULL;
  636 + save_callback = task->tk_callback;
  637 + task->tk_callback = NULL;
642 638 save_callback(task);
643 639 }
644 640