diff options
| author | William Lee Irwin III <wli@holomorphy.com> | 2004-10-18 17:59:41 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-10-18 17:59:41 -0700 |
| commit | fd4d36bf0d54e0b020b8ffeddf7552562eab17c5 (patch) | |
| tree | cdae6036e287c806a7bae414b47ec4993ef2d471 /kernel | |
| parent | d79889923f9c04f6f5592851dc3033236756c5dc (diff) | |
[PATCH] standardize bit waiting data type
Eliminate specialized page and bh waitqueue hashing structures in favor of
a standardized structure, using wake_up_bit() to wake waiters using the
standardized wait_bit_key structure.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/wait.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/kernel/wait.c b/kernel/wait.c index 923a47e7c027..78256a812ca0 100644 --- a/kernel/wait.c +++ b/kernel/wait.c @@ -127,3 +127,26 @@ int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void * return ret; } EXPORT_SYMBOL(autoremove_wake_function); + +int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *arg) +{ + struct wait_bit_key *key = arg; + struct wait_bit_queue *wait_bit + = container_of(wait, struct wait_bit_queue, wait); + + if (wait_bit->key.flags != key->flags || + wait_bit->key.bit_nr != key->bit_nr || + test_bit(key->bit_nr, key->flags)) + return 0; + else + return autoremove_wake_function(wait, mode, sync, key); +} +EXPORT_SYMBOL(wake_bit_function); + +void fastcall __wake_up_bit(wait_queue_head_t *wq, void *word, int bit) +{ + struct wait_bit_key key = __WAIT_BIT_KEY_INITIALIZER(word, bit); + if (waitqueue_active(wq)) + __wake_up(wq, TASK_INTERRUPTIBLE|TASK_UNINTERRUPTIBLE, 1, &key); +} +EXPORT_SYMBOL(__wake_up_bit); |
