History log of /include/linux/completion.h
Revision Date Author Comments
6bf4123760a5aece6e4829ce90b70b6ffd751d65 04-Jan-2011 NeilBrown <neilb@suse.de> sched: Change wait_for_completion_*_timeout() to return a signed long

wait_for_completion_*_timeout() can return:

0: if the wait timed out
-ve: if the wait was interrupted
+ve: if the completion was completed.

As they currently return an 'unsigned long', the last two cases
are not easily distinguished which can easily result in buggy
code, as is the case for the recently added
wait_for_completion_interruptible_timeout() call in
net/sunrpc/cache.c

So change them both to return 'long'. As MAX_SCHEDULE_TIMEOUT
is LONG_MAX, a large +ve return value should never overflow.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: J. Bruce Fields <bfields@fieldses.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <20110105125016.64ccab0e@notabene.brown>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
ee2f154a598e96df2ebb01648a7699373bc085c7 26-Oct-2010 Randy Dunlap <randy.dunlap@oracle.com> docbook: add more wait/wake/completion to device-drivers docbook

Add more wait, wake, and completion interfaces to the device-drivers
docbook.

Fix kernel-doc notation in the added files.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
0aa12fb439838a85802ab8b7fbb9bcfc3e6e05cb 29-May-2010 Sage Weil <sage@newdream.net> sched: add wait_for_completion_killable_timeout

Add missing _killable_timeout variant for wait_for_completion that will
return when a timeout expires or the task is killed.

CC: Ingo Molnar <mingo@elte.hu>
CC: Andreas Herrmann <andreas.herrmann3@amd.com>
CC: Thomas Gleixner <tglx@linutronix.de>
CC: Mike Galbraith <efault@gmx.de>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Sage Weil <sage@newdream.net>
65eb3dc609dec17deea48dcd4de2e549d29a9824 26-Aug-2008 Kevin Diggs <kevdig@hypersurf.com> sched: add kernel doc for the completion, fix kernel-doc-nano-HOWTO.txt

This patch adds kernel doc for the completion feature.

An error in the split-man.pl PERL snippet in kernel-doc-nano-HOWTO.txt is
also fixed.

Signed-off-by: Kevin Diggs <kevdig@hypersurf.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
be4de35263f59ca1f4740edfffbfb02cc3f2189e 15-Aug-2008 Dave Chinner <david@fromorbit.com> completions: uninline try_wait_for_completion and completion_done

m68k fails to build with these functions inlined in completion.h. Move
them out of line into sched.c and export them to avoid this problem.

Signed-off-by: Dave Chinner <david@fromorbit.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
39d2f1ab2a36ac527a6c41cfe689f50c239eaca3 13-Aug-2008 David Chinner <david@fromorbit.com> [XFS] extend completions to provide XFS object flush requirements

XFS object flushing doesn't quite match existing completion semantics. It
mixed exclusive access with completion. That is, we need to mark an object as
being flushed before flushing it to disk, and then block any other attempt to
flush it until the completion occurs. We do this but adding an extra count to
the completion before we start using them. However, we still need to
determine if there is a completion in progress, and allow no-blocking attempts
fo completions to decrement the count.

To do this we introduce:

int try_wait_for_completion(struct completion *x)
returns a failure status if done == 0, otherwise decrements done
to zero and returns a "started" status. This is provided
to allow counted completions to begin safely while holding
object locks in inverted order.

int completion_done(struct completion *x)
returns 1 if there is no waiter, 0 if there is a waiter
(i.e. a completion in progress).

This replaces the use of semaphores for providing this exclusion
and completion mechanism.

SGI-PV: 981498

SGI-Modid: xfs-linux-melb:xfs-kern:31816a

Signed-off-by: David Chinner <david@fromorbit.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
009e577e079656d51d0fe9b15e61e41b00816c29 06-Dec-2007 Matthew Wilcox <matthew@wil.cx> Add wait_for_completion_killable

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
b15136e9497ef5d6e08cf665e0d0acf7a229f6dc 24-Oct-2007 Ingo Molnar <mingo@elte.hu> sched: fix fastcall mismatch in completion APIs

Jeff Dike noticed that wait_for_completion_interruptible()'s prototype
had a mismatched fastcall.

Fix this by removing the fastcall attributes from all the completion APIs.

Found-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
f86bf9b7bcc5d325687a8b80da8ee3eb56e02da7 10-Jul-2006 Ingo Molnar <mingo@elte.hu> [PATCH] lockdep: clean up completion initializer in smpboot.c

Clean up lockdep on-stack-completion initializer. (This also removes the
dependency on waitqueue_lock_key.)

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
8b3db9c542e18b71d4820da4dd9401ee030feacb 03-Jul-2006 Ingo Molnar <mingo@elte.hu> [PATCH] lockdep: add DECLARE_COMPLETION_ONSTACK() API

lockdep needs to have the waitqueue lock initialized for on-stack waitqueues
implicitly initialized by DECLARE_COMPLETION(). Introduce the API.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!