Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

\\\"J. Bruce Fields\\\ and committed by
Trond Myklebust
a486aeda d25a03cf

+5 -10
-1
include/linux/sunrpc/sched.h
··· 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
+5 -9
net/sunrpc/sched.c
··· 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