Lines Matching refs:cl
56 static void bch_data_insert_keys(struct closure *cl) in bch_data_insert_keys() argument
58 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_insert_keys()
71 while (atomic_read(&s->cl.remaining) & CLOSURE_WAITING) in bch_data_insert_keys()
72 closure_sync(&s->cl); in bch_data_insert_keys()
77 op->flush_journal ? cl : NULL); in bch_data_insert_keys()
92 continue_at(cl, bch_data_insert_start, op->wq); in bch_data_insert_keys()
97 closure_return(cl); in bch_data_insert_keys()
118 static void bch_data_invalidate(struct closure *cl) in bch_data_invalidate() argument
120 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_invalidate()
143 continue_at(cl, bch_data_insert_keys, op->wq); in bch_data_invalidate()
146 static void bch_data_insert_error(struct closure *cl) in bch_data_insert_error() argument
148 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_insert_error()
173 bch_data_insert_keys(cl); in bch_data_insert_error()
178 struct closure *cl = bio->bi_private; in bch_data_insert_endio() local
179 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_insert_endio()
186 set_closure_fn(cl, bch_data_insert_error, op->wq); in bch_data_insert_endio()
188 set_closure_fn(cl, NULL, NULL); in bch_data_insert_endio()
194 static void bch_data_insert_start(struct closure *cl) in bch_data_insert_start() argument
196 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_insert_start()
205 return bch_data_invalidate(cl); in bch_data_insert_start()
222 continue_at(cl, bch_data_insert_keys, op->wq); in bch_data_insert_start()
239 n->bi_private = cl; in bch_data_insert_start()
261 continue_at(cl, bch_data_insert_keys, op->wq); in bch_data_insert_start()
281 return bch_data_invalidate(cl); in bch_data_insert_start()
291 continue_at(cl, bch_data_insert_keys, op->wq); in bch_data_insert_start()
293 closure_return(cl); in bch_data_insert_start()
316 void bch_data_insert(struct closure *cl) in bch_data_insert() argument
318 struct data_insert_op *op = container_of(cl, struct data_insert_op, cl); in bch_data_insert()
325 bch_data_insert_start(cl); in bch_data_insert()
462 struct closure cl; member
483 struct closure *cl = bio->bi_private; in bch_cache_read_endio() local
484 struct search *s = container_of(cl, struct search, cl); in bch_cache_read_endio()
556 n->bi_private = &s->cl; in cache_lookup_fn()
573 static void cache_lookup(struct closure *cl) in cache_lookup() argument
575 struct search *s = container_of(cl, struct search, iop.cl); in cache_lookup()
585 continue_at(cl, cache_lookup, bcache_wq); in cache_lookup()
589 closure_return(cl); in cache_lookup()
596 struct closure *cl = bio->bi_private; in request_endio() local
599 struct search *s = container_of(cl, struct search, cl); in request_endio()
606 closure_put(cl); in request_endio()
629 bio->bi_private = &s->cl; in do_bio_hook()
634 static void search_free(struct closure *cl) in search_free() argument
636 struct search *s = container_of(cl, struct search, cl); in search_free()
642 closure_debug_destroy(cl); in search_free()
653 closure_init(&s->cl, NULL); in search_alloc()
679 static void cached_dev_bio_complete(struct closure *cl) in cached_dev_bio_complete() argument
681 struct search *s = container_of(cl, struct search, cl); in cached_dev_bio_complete()
684 search_free(cl); in cached_dev_bio_complete()
690 static void cached_dev_cache_miss_done(struct closure *cl) in cached_dev_cache_miss_done() argument
692 struct search *s = container_of(cl, struct search, cl); in cached_dev_cache_miss_done()
705 cached_dev_bio_complete(cl); in cached_dev_cache_miss_done()
708 static void cached_dev_read_error(struct closure *cl) in cached_dev_read_error() argument
710 struct search *s = container_of(cl, struct search, cl); in cached_dev_read_error()
722 closure_bio_submit(bio, cl); in cached_dev_read_error()
725 continue_at(cl, cached_dev_cache_miss_done, NULL); in cached_dev_read_error()
728 static void cached_dev_read_done(struct closure *cl) in cached_dev_read_done() argument
730 struct search *s = container_of(cl, struct search, cl); in cached_dev_read_done()
762 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_read_done()
765 continue_at(cl, cached_dev_cache_miss_done, NULL); in cached_dev_read_done()
768 static void cached_dev_read_done_bh(struct closure *cl) in cached_dev_read_done_bh() argument
770 struct search *s = container_of(cl, struct search, cl); in cached_dev_read_done_bh()
778 continue_at_nobarrier(cl, cached_dev_read_error, bcache_wq); in cached_dev_read_done_bh()
780 continue_at_nobarrier(cl, cached_dev_read_done, bcache_wq); in cached_dev_read_done_bh()
782 continue_at_nobarrier(cl, cached_dev_bio_complete, NULL); in cached_dev_read_done_bh()
833 cache_bio->bi_private = &s->cl; in cached_dev_cache_miss()
845 closure_bio_submit(cache_bio, &s->cl); in cached_dev_cache_miss()
852 miss->bi_private = &s->cl; in cached_dev_cache_miss()
853 closure_bio_submit(miss, &s->cl); in cached_dev_cache_miss()
859 struct closure *cl = &s->cl; in cached_dev_read() local
861 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in cached_dev_read()
862 continue_at(cl, cached_dev_read_done_bh, NULL); in cached_dev_read()
867 static void cached_dev_write_complete(struct closure *cl) in cached_dev_write_complete() argument
869 struct search *s = container_of(cl, struct search, cl); in cached_dev_write_complete()
873 cached_dev_bio_complete(cl); in cached_dev_write_complete()
878 struct closure *cl = &s->cl; in cached_dev_write() local
918 closure_bio_submit(bio, cl); in cached_dev_write()
931 flush->bi_private = cl; in cached_dev_write()
933 closure_bio_submit(flush, cl); in cached_dev_write()
938 closure_bio_submit(bio, cl); in cached_dev_write()
941 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in cached_dev_write()
942 continue_at(cl, cached_dev_write_complete, NULL); in cached_dev_write()
945 static void cached_dev_nodata(struct closure *cl) in cached_dev_nodata() argument
947 struct search *s = container_of(cl, struct search, cl); in cached_dev_nodata()
951 bch_journal_meta(s->iop.c, cl); in cached_dev_nodata()
954 closure_bio_submit(bio, cl); in cached_dev_nodata()
956 continue_at(cl, cached_dev_bio_complete, NULL); in cached_dev_nodata()
983 continue_at_nobarrier(&s->cl, in cached_dev_make_request()
1066 static void flash_dev_nodata(struct closure *cl) in flash_dev_nodata() argument
1068 struct search *s = container_of(cl, struct search, cl); in flash_dev_nodata()
1071 bch_journal_meta(s->iop.c, cl); in flash_dev_nodata()
1073 continue_at(cl, search_free, NULL); in flash_dev_nodata()
1080 struct closure *cl; in flash_dev_make_request() local
1087 cl = &s->cl; in flash_dev_make_request()
1097 continue_at_nobarrier(&s->cl, in flash_dev_make_request()
1110 closure_call(&s->iop.cl, bch_data_insert, NULL, cl); in flash_dev_make_request()
1112 closure_call(&s->iop.cl, cache_lookup, NULL, cl); in flash_dev_make_request()
1115 continue_at(cl, search_free, NULL); in flash_dev_make_request()