Lines Matching refs:cl
169 void closure_sub(struct closure *cl, int v);
170 void closure_put(struct closure *cl);
172 bool closure_wait(struct closure_waitlist *list, struct closure *cl);
173 void __closure_sync(struct closure *cl);
181 static inline void closure_sync(struct closure *cl) in closure_sync() argument
183 if ((atomic_read(&cl->remaining) & CLOSURE_REMAINING_MASK) != 1) in closure_sync()
184 __closure_sync(cl); in closure_sync()
190 void closure_debug_create(struct closure *cl);
191 void closure_debug_destroy(struct closure *cl);
196 static inline void closure_debug_create(struct closure *cl) {} in closure_debug_create() argument
197 static inline void closure_debug_destroy(struct closure *cl) {} in closure_debug_destroy() argument
201 static inline void closure_set_ip(struct closure *cl) in closure_set_ip() argument
204 cl->ip = _THIS_IP_; in closure_set_ip()
208 static inline void closure_set_ret_ip(struct closure *cl) in closure_set_ret_ip() argument
211 cl->ip = _RET_IP_; in closure_set_ret_ip()
215 static inline void closure_set_waiting(struct closure *cl, unsigned long f) in closure_set_waiting() argument
218 cl->waiting_on = f; in closure_set_waiting()
222 static inline void closure_set_stopped(struct closure *cl) in closure_set_stopped() argument
224 atomic_sub(CLOSURE_RUNNING, &cl->remaining); in closure_set_stopped()
227 static inline void set_closure_fn(struct closure *cl, closure_fn *fn, in set_closure_fn() argument
230 closure_set_ip(cl); in set_closure_fn()
231 cl->fn = fn; in set_closure_fn()
232 cl->wq = wq; in set_closure_fn()
237 static inline void closure_queue(struct closure *cl) in closure_queue() argument
239 struct workqueue_struct *wq = cl->wq; in closure_queue()
247 INIT_WORK(&cl->work, cl->work.func); in closure_queue()
248 BUG_ON(!queue_work(wq, &cl->work)); in closure_queue()
250 cl->fn(cl); in closure_queue()
256 static inline void closure_get(struct closure *cl) in closure_get() argument
259 BUG_ON((atomic_inc_return(&cl->remaining) & in closure_get()
262 atomic_inc(&cl->remaining); in closure_get()
272 static inline void closure_init(struct closure *cl, struct closure *parent) in closure_init() argument
274 memset(cl, 0, sizeof(struct closure)); in closure_init()
275 cl->parent = parent; in closure_init()
279 atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER); in closure_init()
281 closure_debug_create(cl); in closure_init()
282 closure_set_ip(cl); in closure_init()
285 static inline void closure_init_stack(struct closure *cl) in closure_init_stack() argument
287 memset(cl, 0, sizeof(struct closure)); in closure_init_stack()
288 atomic_set(&cl->remaining, CLOSURE_REMAINING_INITIALIZER); in closure_init_stack()
370 static inline void closure_call(struct closure *cl, closure_fn fn, in closure_call() argument
374 closure_init(cl, parent); in closure_call()
375 continue_at_nobarrier(cl, fn, wq); in closure_call()