X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=kernel%2Fasync.c;h=27235f5de198997180d4a293adc932d48c6101c7;hb=2d74b2c62cf8867d0762f6e6b5ed8906cb6a745f;hp=968ef9457d4ec90aeb5148695c31ae02b68d33bb;hpb=2625240d0732ac259591ed54371bc01e7bbfdd14;p=~andy%2Flinux diff --git a/kernel/async.c b/kernel/async.c index 968ef9457d4..27235f5de19 100644 --- a/kernel/async.c +++ b/kernel/async.c @@ -92,19 +92,18 @@ extern int initcall_debug; static async_cookie_t __lowest_in_progress(struct list_head *running) { struct async_entry *entry; + 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; } + list_for_each_entry(entry, &async_pending, list) + if (entry->running == running) + return entry->cookie; + + return next_cookie; /* "infinity" value */ } static async_cookie_t lowest_in_progress(struct list_head *running)