Lines Matching refs:wq_entry
17 void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue() argument
21 wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; in add_wait_queue()
23 __add_wait_queue(wq_head, wq_entry); in add_wait_queue()
28 void add_wait_queue_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_exclusive() argument
32 wq_entry->flags |= WQ_FLAG_EXCLUSIVE; in add_wait_queue_exclusive()
34 __add_wait_queue_entry_tail(wq_head, wq_entry); in add_wait_queue_exclusive()
39 void add_wait_queue_priority(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in add_wait_queue_priority() argument
43 wq_entry->flags |= WQ_FLAG_EXCLUSIVE | WQ_FLAG_PRIORITY; in add_wait_queue_priority()
45 __add_wait_queue(wq_head, wq_entry); in add_wait_queue_priority()
50 void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in remove_wait_queue() argument
55 __remove_wait_queue(wq_head, wq_entry); in remove_wait_queue()
269 prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) in prepare_to_wait() argument
273 wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; in prepare_to_wait()
275 if (list_empty(&wq_entry->entry)) in prepare_to_wait()
276 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait()
284 prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int s… in prepare_to_wait_exclusive() argument
289 wq_entry->flags |= WQ_FLAG_EXCLUSIVE; in prepare_to_wait_exclusive()
291 if (list_empty(&wq_entry->entry)) { in prepare_to_wait_exclusive()
293 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_exclusive()
301 void init_wait_entry(struct wait_queue_entry *wq_entry, int flags) in init_wait_entry() argument
303 wq_entry->flags = flags; in init_wait_entry()
304 wq_entry->private = current; in init_wait_entry()
305 wq_entry->func = autoremove_wake_function; in init_wait_entry()
306 INIT_LIST_HEAD(&wq_entry->entry); in init_wait_entry()
310 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int … in prepare_to_wait_event() argument
329 list_del_init(&wq_entry->entry); in prepare_to_wait_event()
332 if (list_empty(&wq_entry->entry)) { in prepare_to_wait_event()
333 if (wq_entry->flags & WQ_FLAG_EXCLUSIVE) in prepare_to_wait_event()
334 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_event()
336 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait_event()
396 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in finish_wait() argument
414 if (!list_empty_careful(&wq_entry->entry)) { in finish_wait()
416 list_del_init(&wq_entry->entry); in finish_wait()
422 int autoremove_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in autoremove_wake_function() argument
424 int ret = default_wake_function(wq_entry, mode, sync, key); in autoremove_wake_function()
427 list_del_init_careful(&wq_entry->entry); in autoremove_wake_function()
453 long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long timeout) in wait_woken() argument
462 if (!(wq_entry->flags & WQ_FLAG_WOKEN) && !kthread_should_stop_or_park()) in wait_woken()
472 smp_store_mb(wq_entry->flags, wq_entry->flags & ~WQ_FLAG_WOKEN); /* B */ in wait_woken()
478 int woken_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in woken_wake_function() argument
482 wq_entry->flags |= WQ_FLAG_WOKEN; in woken_wake_function()
484 return default_wake_function(wq_entry, mode, sync, key); in woken_wake_function()