Lines Matching refs:cl

14 static inline void closure_put_after_sub(struct closure *cl, int flags)  in closure_put_after_sub()  argument
23 wake_up_process(cl->task); in closure_put_after_sub()
26 if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) { in closure_put_after_sub()
27 atomic_set(&cl->remaining, in closure_put_after_sub()
29 closure_queue(cl); in closure_put_after_sub()
31 struct closure *parent = cl->parent; in closure_put_after_sub()
32 closure_fn *destructor = cl->fn; in closure_put_after_sub()
34 closure_debug_destroy(cl); in closure_put_after_sub()
37 destructor(cl); in closure_put_after_sub()
46 void closure_sub(struct closure *cl, int v) in closure_sub() argument
48 closure_put_after_sub(cl, atomic_sub_return(v, &cl->remaining)); in closure_sub()
55 void closure_put(struct closure *cl) in closure_put() argument
57 closure_put_after_sub(cl, atomic_dec_return(&cl->remaining)); in closure_put()
67 struct closure *cl; in __closure_wake_up() local
85 cl = container_of(reverse, struct closure, list); in __closure_wake_up()
88 closure_set_waiting(cl, 0); in __closure_wake_up()
89 closure_sub(cl, CLOSURE_WAITING + 1); in __closure_wake_up()
101 bool closure_wait(struct closure_waitlist *waitlist, struct closure *cl) in closure_wait() argument
103 if (atomic_read(&cl->remaining) & CLOSURE_WAITING) in closure_wait()
106 closure_set_waiting(cl, _RET_IP_); in closure_wait()
107 atomic_add(CLOSURE_WAITING + 1, &cl->remaining); in closure_wait()
108 llist_add(&cl->list, &waitlist->list); in closure_wait()
120 void closure_sync(struct closure *cl) in closure_sync() argument
123 __closure_start_sleep(cl); in closure_sync()
124 closure_set_ret_ip(cl); in closure_sync()
126 if ((atomic_read(&cl->remaining) & in closure_sync()
133 __closure_end_sleep(cl); in closure_sync()
142 void closure_debug_create(struct closure *cl) in closure_debug_create() argument
146 BUG_ON(cl->magic == CLOSURE_MAGIC_ALIVE); in closure_debug_create()
147 cl->magic = CLOSURE_MAGIC_ALIVE; in closure_debug_create()
150 list_add(&cl->all, &closure_list); in closure_debug_create()
155 void closure_debug_destroy(struct closure *cl) in closure_debug_destroy() argument
159 BUG_ON(cl->magic != CLOSURE_MAGIC_ALIVE); in closure_debug_destroy()
160 cl->magic = CLOSURE_MAGIC_DEAD; in closure_debug_destroy()
163 list_del(&cl->all); in closure_debug_destroy()
174 struct closure *cl; in debug_seq_show() local
177 list_for_each_entry(cl, &closure_list, all) { in debug_seq_show()
178 int r = atomic_read(&cl->remaining); in debug_seq_show()
181 cl, (void *) cl->ip, cl->fn, cl->parent, in debug_seq_show()
186 work_data_bits(&cl->work)) ? "Q" : "", in debug_seq_show()
193 (void *) cl->waiting_on); in debug_seq_show()