Lines Matching refs:cl

174 void closure_sub(struct closure *cl, int v);
175 void closure_put(struct closure *cl);
177 bool closure_wait(struct closure_waitlist *list, struct closure *cl);
178 void closure_sync(struct closure *cl);
183 void closure_debug_create(struct closure *cl);
184 void closure_debug_destroy(struct closure *cl);
189 static inline void closure_debug_create(struct closure *cl) {} in closure_debug_create() argument
190 static inline void closure_debug_destroy(struct closure *cl) {} in closure_debug_destroy() argument
194 static inline void closure_set_ip(struct closure *cl) in closure_set_ip() argument
197 cl->ip = _THIS_IP_; in closure_set_ip()
201 static inline void closure_set_ret_ip(struct closure *cl) in closure_set_ret_ip() argument
204 cl->ip = _RET_IP_; in closure_set_ret_ip()
208 static inline void closure_set_waiting(struct closure *cl, unsigned long f) in closure_set_waiting() argument
211 cl->waiting_on = f; in closure_set_waiting()
215 static inline void __closure_end_sleep(struct closure *cl) in __closure_end_sleep() argument
219 if (atomic_read(&cl->remaining) & CLOSURE_SLEEPING) in __closure_end_sleep()
220 atomic_sub(CLOSURE_SLEEPING, &cl->remaining); in __closure_end_sleep()
223 static inline void __closure_start_sleep(struct closure *cl) in __closure_start_sleep() argument
225 closure_set_ip(cl); in __closure_start_sleep()
226 cl->task = current; in __closure_start_sleep()
229 if (!(atomic_read(&cl->remaining) & CLOSURE_SLEEPING)) in __closure_start_sleep()
230 atomic_add(CLOSURE_SLEEPING, &cl->remaining); in __closure_start_sleep()
233 static inline void closure_set_stopped(struct closure *cl) in closure_set_stopped() argument
235 atomic_sub(CLOSURE_RUNNING, &cl->remaining); in closure_set_stopped()
238 static inline void set_closure_fn(struct closure *cl, closure_fn *fn, in set_closure_fn() argument
241 BUG_ON(object_is_on_stack(cl)); in set_closure_fn()
242 closure_set_ip(cl); in set_closure_fn()
243 cl->fn = fn; in set_closure_fn()
244 cl->wq = wq; in set_closure_fn()
249 static inline void closure_queue(struct closure *cl) in closure_queue() argument
251 struct workqueue_struct *wq = cl->wq; in closure_queue()
253 INIT_WORK(&cl->work, cl->work.func); in closure_queue()
254 BUG_ON(!queue_work(wq, &cl->work)); in closure_queue()
256 cl->fn(cl); in closure_queue()
262 static inline void closure_get(struct closure *cl) in closure_get() argument
265 BUG_ON((atomic_inc_return(&cl->remaining) & in closure_get()
268 atomic_inc(&cl->remaining); in closure_get()
278 static inline void closure_init(struct closure *cl, struct closure *parent) in closure_init() argument
280 memset(cl, 0, sizeof(struct closure)); in closure_init()
281 cl->parent = parent; in closure_init()
285 atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER); in closure_init()
287 closure_debug_create(cl); in closure_init()
288 closure_set_ip(cl); in closure_init()
291 static inline void closure_init_stack(struct closure *cl) in closure_init_stack() argument
293 memset(cl, 0, sizeof(struct closure)); in closure_init_stack()
294 atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER|CLOSURE_STACK); in closure_init_stack()
375 static inline void closure_call(struct closure *cl, closure_fn fn, in closure_call() argument
379 closure_init(cl, parent); in closure_call()
380 continue_at_nobarrier(cl, fn, wq); in closure_call()