diff options
author | Benjamin LaHaise <bcrl@kvack.org> | 2005-06-23 03:10:27 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-23 12:45:34 -0400 |
commit | c43dc2fd885b5658cfd7cedb7bcca20910c517a4 (patch) | |
tree | 98b723badf4a71c9dbf04cfd0babcb02ac577982 | |
parent | 63e6880918e75dcb92d60aff218a76e063a471ef (diff) |
[PATCH] aio: make wait_queue ->task ->private
In the upcoming aio_down patch, it is useful to store a private data
pointer in the kiocb's wait_queue. Since we provide our own wake up
function and do not require the task_struct pointer, it makes sense to
convert the task pointer into a generic private pointer.
Signed-off-by: Benjamin LaHaise <benjamin.c.lahaise@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/wait.h | 16 | ||||
-rw-r--r-- | kernel/sched.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/include/linux/wait.h b/include/linux/wait.h index c9486c3efb4a..d38c9fecdc36 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
@@ -33,7 +33,7 @@ int default_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key | |||
33 | struct __wait_queue { | 33 | struct __wait_queue { |
34 | unsigned int flags; | 34 | unsigned int flags; |
35 | #define WQ_FLAG_EXCLUSIVE 0x01 | 35 | #define WQ_FLAG_EXCLUSIVE 0x01 |
36 | struct task_struct * task; | 36 | void *private; |
37 | wait_queue_func_t func; | 37 | wait_queue_func_t func; |
38 | struct list_head task_list; | 38 | struct list_head task_list; |
39 | }; | 39 | }; |
@@ -60,7 +60,7 @@ typedef struct __wait_queue_head wait_queue_head_t; | |||
60 | */ | 60 | */ |
61 | 61 | ||
62 | #define __WAITQUEUE_INITIALIZER(name, tsk) { \ | 62 | #define __WAITQUEUE_INITIALIZER(name, tsk) { \ |
63 | .task = tsk, \ | 63 | .private = tsk, \ |
64 | .func = default_wake_function, \ | 64 | .func = default_wake_function, \ |
65 | .task_list = { NULL, NULL } } | 65 | .task_list = { NULL, NULL } } |
66 | 66 | ||
@@ -86,7 +86,7 @@ static inline void init_waitqueue_head(wait_queue_head_t *q) | |||
86 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) | 86 | static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) |
87 | { | 87 | { |
88 | q->flags = 0; | 88 | q->flags = 0; |
89 | q->task = p; | 89 | q->private = p; |
90 | q->func = default_wake_function; | 90 | q->func = default_wake_function; |
91 | } | 91 | } |
92 | 92 | ||
@@ -94,7 +94,7 @@ static inline void init_waitqueue_func_entry(wait_queue_t *q, | |||
94 | wait_queue_func_t func) | 94 | wait_queue_func_t func) |
95 | { | 95 | { |
96 | q->flags = 0; | 96 | q->flags = 0; |
97 | q->task = NULL; | 97 | q->private = NULL; |
98 | q->func = func; | 98 | q->func = func; |
99 | } | 99 | } |
100 | 100 | ||
@@ -110,7 +110,7 @@ static inline int waitqueue_active(wait_queue_head_t *q) | |||
110 | * aio specifies a wait queue entry with an async notification | 110 | * aio specifies a wait queue entry with an async notification |
111 | * callback routine, not associated with any task. | 111 | * callback routine, not associated with any task. |
112 | */ | 112 | */ |
113 | #define is_sync_wait(wait) (!(wait) || ((wait)->task)) | 113 | #define is_sync_wait(wait) (!(wait) || ((wait)->private)) |
114 | 114 | ||
115 | extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); | 115 | extern void FASTCALL(add_wait_queue(wait_queue_head_t *q, wait_queue_t * wait)); |
116 | extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); | 116 | extern void FASTCALL(add_wait_queue_exclusive(wait_queue_head_t *q, wait_queue_t * wait)); |
@@ -384,7 +384,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
384 | 384 | ||
385 | #define DEFINE_WAIT(name) \ | 385 | #define DEFINE_WAIT(name) \ |
386 | wait_queue_t name = { \ | 386 | wait_queue_t name = { \ |
387 | .task = current, \ | 387 | .private = current, \ |
388 | .func = autoremove_wake_function, \ | 388 | .func = autoremove_wake_function, \ |
389 | .task_list = LIST_HEAD_INIT((name).task_list), \ | 389 | .task_list = LIST_HEAD_INIT((name).task_list), \ |
390 | } | 390 | } |
@@ -393,7 +393,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
393 | struct wait_bit_queue name = { \ | 393 | struct wait_bit_queue name = { \ |
394 | .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \ | 394 | .key = __WAIT_BIT_KEY_INITIALIZER(word, bit), \ |
395 | .wait = { \ | 395 | .wait = { \ |
396 | .task = current, \ | 396 | .private = current, \ |
397 | .func = wake_bit_function, \ | 397 | .func = wake_bit_function, \ |
398 | .task_list = \ | 398 | .task_list = \ |
399 | LIST_HEAD_INIT((name).wait.task_list), \ | 399 | LIST_HEAD_INIT((name).wait.task_list), \ |
@@ -402,7 +402,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
402 | 402 | ||
403 | #define init_wait(wait) \ | 403 | #define init_wait(wait) \ |
404 | do { \ | 404 | do { \ |
405 | (wait)->task = current; \ | 405 | (wait)->private = current; \ |
406 | (wait)->func = autoremove_wake_function; \ | 406 | (wait)->func = autoremove_wake_function; \ |
407 | INIT_LIST_HEAD(&(wait)->task_list); \ | 407 | INIT_LIST_HEAD(&(wait)->task_list); \ |
408 | } while (0) | 408 | } while (0) |
diff --git a/kernel/sched.c b/kernel/sched.c index 6ee4515d5a20..76080d142e3d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -2869,7 +2869,7 @@ need_resched: | |||
2869 | 2869 | ||
2870 | int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, void *key) | 2870 | int default_wake_function(wait_queue_t *curr, unsigned mode, int sync, void *key) |
2871 | { | 2871 | { |
2872 | task_t *p = curr->task; | 2872 | task_t *p = curr->private; |
2873 | return try_to_wake_up(p, mode, sync); | 2873 | return try_to_wake_up(p, mode, sync); |
2874 | } | 2874 | } |
2875 | 2875 | ||