From d32b25a6411855e4c319bdcb94b0efe130737d2f Mon Sep 17 00:00:00 2001 From: James Bottomley Date: Sun, 24 May 2009 13:03:43 -0700 Subject: [PATCH] --- yaml --- r: 145236 b: refs/heads/master c: d5a877e8dd409d8c702986d06485c374b705d340 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/async.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/[refs] b/[refs] index ac59a991e673..8fdbaf0311d9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 657cafa6b0f5296424d6f43f6f6eeb4a3222117e +refs/heads/master: d5a877e8dd409d8c702986d06485c374b705d340 diff --git a/trunk/kernel/async.c b/trunk/kernel/async.c index 968ef9457d4e..50540301ed0f 100644 --- a/trunk/kernel/async.c +++ b/trunk/kernel/async.c @@ -92,19 +92,23 @@ extern int initcall_debug; static async_cookie_t __lowest_in_progress(struct list_head *running) { struct async_entry *entry; + async_cookie_t ret = next_cookie; /* begin with "infinity" value */ + if (!list_empty(running)) { entry = list_first_entry(running, struct async_entry, list); - return entry->cookie; - } else if (!list_empty(&async_pending)) { - entry = list_first_entry(&async_pending, - struct async_entry, list); - return entry->cookie; - } else { - /* nothing in progress... next_cookie is "infinity" */ - return next_cookie; + ret = entry->cookie; } + if (!list_empty(&async_pending)) { + list_for_each_entry(entry, &async_pending, list) + if (entry->running == running) { + ret = entry->cookie; + break; + } + } + + return ret; } static async_cookie_t lowest_in_progress(struct list_head *running)