diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-03 03:55:03 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-01-06 14:58:39 -0500 |
commit | abbcf28f23d53e8ec56a91f3528743913fa2694a (patch) | |
tree | 97dafc3840e4660ac0fcf99bbdc7eddc2fecd08a /net/sunrpc/sched.c | |
parent | abd3e641d5ef9f836ab2f2b04d80b8619b051531 (diff) |
SUNRPC: Yet more RPC cleanups
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/sched.c')
-rw-r--r-- | net/sunrpc/sched.c | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 54e60a657500..3fcf7b0e1f6c 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -555,28 +555,22 @@ __rpc_atrun(struct rpc_task *task) | |||
555 | } | 555 | } |
556 | 556 | ||
557 | /* | 557 | /* |
558 | * Helper that calls task->tk_exit if it exists and then returns | 558 | * Helper that calls task->tk_exit if it exists |
559 | * true if we should exit __rpc_execute. | ||
560 | */ | 559 | */ |
561 | static inline int __rpc_do_exit(struct rpc_task *task) | 560 | void rpc_exit_task(struct rpc_task *task) |
562 | { | 561 | { |
562 | task->tk_action = NULL; | ||
563 | if (task->tk_exit != NULL) { | 563 | if (task->tk_exit != NULL) { |
564 | lock_kernel(); | ||
565 | task->tk_exit(task); | 564 | task->tk_exit(task); |
566 | unlock_kernel(); | ||
567 | /* If tk_action is non-null, we should restart the call */ | ||
568 | if (task->tk_action != NULL) { | 565 | if (task->tk_action != NULL) { |
569 | if (!RPC_ASSASSINATED(task)) { | 566 | WARN_ON(RPC_ASSASSINATED(task)); |
570 | /* Release RPC slot and buffer memory */ | 567 | /* Always release the RPC slot and buffer memory */ |
571 | xprt_release(task); | 568 | xprt_release(task); |
572 | rpc_free(task); | 569 | rpc_free(task); |
573 | return 0; | ||
574 | } | ||
575 | printk(KERN_ERR "RPC: dead task tried to walk away.\n"); | ||
576 | } | 570 | } |
577 | } | 571 | } |
578 | return 1; | ||
579 | } | 572 | } |
573 | EXPORT_SYMBOL(rpc_exit_task); | ||
580 | 574 | ||
581 | static int rpc_wait_bit_interruptible(void *word) | 575 | static int rpc_wait_bit_interruptible(void *word) |
582 | { | 576 | { |
@@ -631,12 +625,11 @@ static int __rpc_execute(struct rpc_task *task) | |||
631 | * by someone else. | 625 | * by someone else. |
632 | */ | 626 | */ |
633 | if (!RPC_IS_QUEUED(task)) { | 627 | if (!RPC_IS_QUEUED(task)) { |
634 | if (task->tk_action != NULL) { | 628 | if (task->tk_action == NULL) |
635 | lock_kernel(); | ||
636 | task->tk_action(task); | ||
637 | unlock_kernel(); | ||
638 | } else if (__rpc_do_exit(task)) | ||
639 | break; | 629 | break; |
630 | lock_kernel(); | ||
631 | task->tk_action(task); | ||
632 | unlock_kernel(); | ||
640 | } | 633 | } |
641 | 634 | ||
642 | /* | 635 | /* |