diff options
| author | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-08 12:21:27 +0100 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-06-08 12:21:27 +0100 |
| commit | e635a01ea0a16cf7cd31ecd2305870385dca9be6 (patch) | |
| tree | c7153e7dee5caf6ac90d85694ff27e4d0b606290 /kernel/async.c | |
| parent | 143070e74630b9557e1bb64d899ff2cc5a1dcb48 (diff) | |
| parent | 947391cfbaa3b08558844c0b187bcd0223c3f660 (diff) | |
Merge branch 'next-mtd' of git://aeryn.fluff.org.uk/bjdooks/linux
Diffstat (limited to 'kernel/async.c')
| -rw-r--r-- | kernel/async.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/kernel/async.c b/kernel/async.c index 968ef9457d4e..50540301ed0f 100644 --- a/kernel/async.c +++ b/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) |
