Lines Matching refs:wq_entry
18 void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue() argument
22 wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; in add_wait_queue()
24 __add_wait_queue(wq_head, wq_entry); in add_wait_queue()
29 void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_exclusive() argument
33 wq_entry->flags |= WQ_FLAG_EXCLUSIVE; in add_wait_queue_exclusive()
35 __add_wait_queue_entry_tail(wq_head, wq_entry); in add_wait_queue_exclusive()
40 void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in remove_wait_queue() argument
45 __remove_wait_queue(wq_head, wq_entry); in remove_wait_queue()
222 prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) in prepare_to_wait() argument
226 wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; in prepare_to_wait()
228 if (list_empty(&wq_entry->entry)) in prepare_to_wait()
229 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait()
236 prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int s… in prepare_to_wait_exclusive() argument
240 wq_entry->flags |= WQ_FLAG_EXCLUSIVE; in prepare_to_wait_exclusive()
242 if (list_empty(&wq_entry->entry)) in prepare_to_wait_exclusive()
243 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_exclusive()
249 void init_wait_entry(struct wait_queue_entry *wq_entry, int flags) in init_wait_entry() argument
251 wq_entry->flags = flags; in init_wait_entry()
252 wq_entry->private = current; in init_wait_entry()
253 wq_entry->func = autoremove_wake_function; in init_wait_entry()
254 INIT_LIST_HEAD(&wq_entry->entry); in init_wait_entry()
258 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int … in prepare_to_wait_event() argument
277 list_del_init(&wq_entry->entry); in prepare_to_wait_event()
280 if (list_empty(&wq_entry->entry)) { in prepare_to_wait_event()
281 if (wq_entry->flags & WQ_FLAG_EXCLUSIVE) in prepare_to_wait_event()
282 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_event()
284 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait_event()
344 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in finish_wait() argument
362 if (!list_empty_careful(&wq_entry->entry)) { in finish_wait()
364 list_del_init(&wq_entry->entry); in finish_wait()
370 int autoremove_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in autoremove_wake_function() argument
372 int ret = default_wake_function(wq_entry, mode, sync, key); in autoremove_wake_function()
375 list_del_init(&wq_entry->entry); in autoremove_wake_function()
406 long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long timeout) in wait_woken() argument
415 if (!(wq_entry->flags & WQ_FLAG_WOKEN) && !is_kthread_should_stop()) in wait_woken()
425 smp_store_mb(wq_entry->flags, wq_entry->flags & ~WQ_FLAG_WOKEN); /* B */ in wait_woken()
431 int woken_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in woken_wake_function() argument
435 wq_entry->flags |= WQ_FLAG_WOKEN; in woken_wake_function()
437 return default_wake_function(wq_entry, mode, sync, key); in woken_wake_function()