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()
260 prepare_to_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int state) in prepare_to_wait() argument
264 wq_entry->flags &= ~WQ_FLAG_EXCLUSIVE; in prepare_to_wait()
266 if (list_empty(&wq_entry->entry)) in prepare_to_wait()
267 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait()
275 prepare_to_wait_exclusive(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int s… in prepare_to_wait_exclusive() argument
280 wq_entry->flags |= WQ_FLAG_EXCLUSIVE; in prepare_to_wait_exclusive()
282 if (list_empty(&wq_entry->entry)) { in prepare_to_wait_exclusive()
284 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_exclusive()
292 void init_wait_entry(struct wait_queue_entry *wq_entry, int flags) in init_wait_entry() argument
294 wq_entry->flags = flags; in init_wait_entry()
295 wq_entry->private = current; in init_wait_entry()
296 wq_entry->func = autoremove_wake_function; in init_wait_entry()
297 INIT_LIST_HEAD(&wq_entry->entry); in init_wait_entry()
301 long prepare_to_wait_event(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry, int … in prepare_to_wait_event() argument
320 list_del_init(&wq_entry->entry); in prepare_to_wait_event()
323 if (list_empty(&wq_entry->entry)) { in prepare_to_wait_event()
324 if (wq_entry->flags & WQ_FLAG_EXCLUSIVE) in prepare_to_wait_event()
325 __add_wait_queue_entry_tail(wq_head, wq_entry); in prepare_to_wait_event()
327 __add_wait_queue(wq_head, wq_entry); in prepare_to_wait_event()
387 void finish_wait(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry) in finish_wait() argument
405 if (!list_empty_careful(&wq_entry->entry)) { in finish_wait()
407 list_del_init(&wq_entry->entry); in finish_wait()
413 int autoremove_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in autoremove_wake_function() argument
415 int ret = default_wake_function(wq_entry, mode, sync, key); in autoremove_wake_function()
418 list_del_init_careful(&wq_entry->entry); in autoremove_wake_function()
449 long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long timeout) in wait_woken() argument
458 if (!(wq_entry->flags & WQ_FLAG_WOKEN) && !is_kthread_should_stop()) in wait_woken()
468 smp_store_mb(wq_entry->flags, wq_entry->flags & ~WQ_FLAG_WOKEN); /* B */ in wait_woken()
474 int woken_wake_function(struct wait_queue_entry *wq_entry, unsigned mode, int sync, void *key) in woken_wake_function() argument
478 wq_entry->flags |= WQ_FLAG_WOKEN; in woken_wake_function()
480 return default_wake_function(wq_entry, mode, sync, key); in woken_wake_function()