Lines Matching refs:cl

16 static inline void closure_put_after_sub(struct closure *cl, int flags)
26 cl->closure_get_happened = false;
28 if (cl->fn && !(flags & CLOSURE_DESTRUCTOR)) {
29 atomic_set(&cl->remaining,
31 closure_queue(cl);
33 struct closure *parent = cl->parent;
34 closure_fn *destructor = cl->fn;
36 closure_debug_destroy(cl);
39 destructor(&cl->work);
48 void closure_sub(struct closure *cl, int v)
50 closure_put_after_sub(cl, atomic_sub_return_release(v, &cl->remaining));
57 void closure_put(struct closure *cl)
59 closure_put_after_sub(cl, atomic_dec_return_release(&cl->remaining));
69 struct closure *cl, *t;
78 llist_for_each_entry_safe(cl, t, reverse, list) {
79 closure_set_waiting(cl, 0);
80 closure_sub(cl, CLOSURE_WAITING + 1);
87 * @waitlist: will own a ref on @cl, which will be released when
89 * @cl: closure pointer.
92 bool closure_wait(struct closure_waitlist *waitlist, struct closure *cl)
94 if (atomic_read(&cl->remaining) & CLOSURE_WAITING)
97 cl->closure_get_happened = true;
98 closure_set_waiting(cl, _RET_IP_);
99 atomic_add(CLOSURE_WAITING + 1, &cl->remaining);
100 llist_add(&cl->list, &waitlist->list);
113 struct closure *cl = container_of(ws, struct closure, work);
114 struct closure_syncer *s = cl->s;
124 void __sched __closure_sync(struct closure *cl)
128 cl->s = &s;
129 continue_at(cl, closure_sync_fn, NULL);
147 void closure_debug_create(struct closure *cl)
151 BUG_ON(cl->magic == CLOSURE_MAGIC_ALIVE);
152 cl->magic = CLOSURE_MAGIC_ALIVE;
155 list_add(&cl->all, &closure_list);
160 void closure_debug_destroy(struct closure *cl)
164 BUG_ON(cl->magic != CLOSURE_MAGIC_ALIVE);
165 cl->magic = CLOSURE_MAGIC_DEAD;
168 list_del(&cl->all);
175 struct closure *cl;
179 list_for_each_entry(cl, &closure_list, all) {
180 int r = atomic_read(&cl->remaining);
183 cl, (void *) cl->ip, cl->fn, cl->parent,
188 work_data_bits(&cl->work)) ? "Q" : "",
193 (void *) cl->waiting_on);