aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author\\\"J. Bruce Fields\\\ <bfields@citi.umich.edu>2008-06-09 16:51:35 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-07-09 12:09:14 -0400
commita486aeda9b2b0d944aecce7871b3186379b898de (patch)
tree724ee69f012083efcd379733ba783efbe6341ab2
parentd25a03cf966f2cf9990dc0bf2a921a554919ea34 (diff)
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>
-rw-r--r--include/linux/sunrpc/sched.h1
-rw-r--r--net/sunrpc/sched.c14
2 files changed, 5 insertions, 10 deletions
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index d1a5c8c1a0f1..64981a2f1cae 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -135,7 +135,6 @@ struct rpc_task_setup {
135#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 135#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
136#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) 136#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
137#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 137#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
138#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
139#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) 138#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
140 139
141#define RPC_TASK_RUNNING 0 140#define RPC_TASK_RUNNING 0
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
index 6eab9bf94baf..6288af05c20f 100644
--- a/net/sunrpc/sched.c
+++ b/net/sunrpc/sched.c
@@ -626,19 +626,15 @@ static void __rpc_execute(struct rpc_task *task)
626 /* 626 /*
627 * Execute any pending callback. 627 * Execute any pending callback.
628 */ 628 */
629 if (RPC_DO_CALLBACK(task)) { 629 if (task->tk_callback) {
630 /* Define a callback save pointer */
631 void (*save_callback)(struct rpc_task *); 630 void (*save_callback)(struct rpc_task *);
632 631
633 /* 632 /*
634 * If a callback exists, save it, reset it, 633 * We set tk_callback to NULL before calling it,
635 * call it. 634 * in case it sets the tk_callback field itself:
636 * The save is needed to stop from resetting
637 * another callback set within the callback handler
638 * - Dave
639 */ 635 */
640 save_callback=task->tk_callback; 636 save_callback = task->tk_callback;
641 task->tk_callback=NULL; 637 task->tk_callback = NULL;
642 save_callback(task); 638 save_callback(task);
643 } 639 }
644 640