2525
2626struct kmem_cache * bch_search_cache ;
2727
28- static void bch_data_insert_start ( struct closure * cl );
28+ static CLOSURE_CALLBACK ( bch_data_insert_start );
2929
3030static unsigned int cache_mode (struct cached_dev * dc )
3131{
@@ -55,9 +55,9 @@ static void bio_csum(struct bio *bio, struct bkey *k)
5555
5656/* Insert data into cache */
5757
58- static void bch_data_insert_keys ( struct closure * cl )
58+ static CLOSURE_CALLBACK ( bch_data_insert_keys )
5959{
60- struct data_insert_op * op = container_of ( cl , struct data_insert_op , cl );
60+ closure_type ( op , struct data_insert_op , cl );
6161 atomic_t * journal_ref = NULL ;
6262 struct bkey * replace_key = op -> replace ? & op -> replace_key : NULL ;
6363 int ret ;
@@ -136,9 +136,9 @@ static void bch_data_invalidate(struct closure *cl)
136136 continue_at (cl , bch_data_insert_keys , op -> wq );
137137}
138138
139- static void bch_data_insert_error ( struct closure * cl )
139+ static CLOSURE_CALLBACK ( bch_data_insert_error )
140140{
141- struct data_insert_op * op = container_of ( cl , struct data_insert_op , cl );
141+ closure_type ( op , struct data_insert_op , cl );
142142
143143 /*
144144 * Our data write just errored, which means we've got a bunch of keys to
@@ -163,7 +163,7 @@ static void bch_data_insert_error(struct closure *cl)
163163
164164 op -> insert_keys .top = dst ;
165165
166- bch_data_insert_keys (cl );
166+ bch_data_insert_keys (& cl -> work );
167167}
168168
169169static void bch_data_insert_endio (struct bio * bio )
@@ -184,9 +184,9 @@ static void bch_data_insert_endio(struct bio *bio)
184184 bch_bbio_endio (op -> c , bio , bio -> bi_status , "writing data to cache" );
185185}
186186
187- static void bch_data_insert_start ( struct closure * cl )
187+ static CLOSURE_CALLBACK ( bch_data_insert_start )
188188{
189- struct data_insert_op * op = container_of ( cl , struct data_insert_op , cl );
189+ closure_type ( op , struct data_insert_op , cl );
190190 struct bio * bio = op -> bio , * n ;
191191
192192 if (op -> bypass )
@@ -305,16 +305,16 @@ static void bch_data_insert_start(struct closure *cl)
305305 * If op->bypass is true, instead of inserting the data it invalidates the
306306 * region of the cache represented by op->bio and op->inode.
307307 */
308- void bch_data_insert ( struct closure * cl )
308+ CLOSURE_CALLBACK ( bch_data_insert )
309309{
310- struct data_insert_op * op = container_of ( cl , struct data_insert_op , cl );
310+ closure_type ( op , struct data_insert_op , cl );
311311
312312 trace_bcache_write (op -> c , op -> inode , op -> bio ,
313313 op -> writeback , op -> bypass );
314314
315315 bch_keylist_init (& op -> insert_keys );
316316 bio_get (op -> bio );
317- bch_data_insert_start (cl );
317+ bch_data_insert_start (& cl -> work );
318318}
319319
320320/*
@@ -575,9 +575,9 @@ static int cache_lookup_fn(struct btree_op *op, struct btree *b, struct bkey *k)
575575 return n == bio ? MAP_DONE : MAP_CONTINUE ;
576576}
577577
578- static void cache_lookup ( struct closure * cl )
578+ static CLOSURE_CALLBACK ( cache_lookup )
579579{
580- struct search * s = container_of ( cl , struct search , iop .cl );
580+ closure_type ( s , struct search , iop .cl );
581581 struct bio * bio = & s -> bio .bio ;
582582 struct cached_dev * dc ;
583583 int ret ;
@@ -698,9 +698,9 @@ static void do_bio_hook(struct search *s,
698698 bio_cnt_set (bio , 3 );
699699}
700700
701- static void search_free ( struct closure * cl )
701+ static CLOSURE_CALLBACK ( search_free )
702702{
703- struct search * s = container_of ( cl , struct search , cl );
703+ closure_type ( s , struct search , cl );
704704
705705 atomic_dec (& s -> iop .c -> search_inflight );
706706
@@ -749,33 +749,33 @@ static inline struct search *search_alloc(struct bio *bio,
749749
750750/* Cached devices */
751751
752- static void cached_dev_bio_complete ( struct closure * cl )
752+ static CLOSURE_CALLBACK ( cached_dev_bio_complete )
753753{
754- struct search * s = container_of ( cl , struct search , cl );
754+ closure_type ( s , struct search , cl );
755755 struct cached_dev * dc = container_of (s -> d , struct cached_dev , disk );
756756
757757 cached_dev_put (dc );
758- search_free (cl );
758+ search_free (& cl -> work );
759759}
760760
761761/* Process reads */
762762
763- static void cached_dev_read_error_done ( struct closure * cl )
763+ static CLOSURE_CALLBACK ( cached_dev_read_error_done )
764764{
765- struct search * s = container_of ( cl , struct search , cl );
765+ closure_type ( s , struct search , cl );
766766
767767 if (s -> iop .replace_collision )
768768 bch_mark_cache_miss_collision (s -> iop .c , s -> d );
769769
770770 if (s -> iop .bio )
771771 bio_free_pages (s -> iop .bio );
772772
773- cached_dev_bio_complete (cl );
773+ cached_dev_bio_complete (& cl -> work );
774774}
775775
776- static void cached_dev_read_error ( struct closure * cl )
776+ static CLOSURE_CALLBACK ( cached_dev_read_error )
777777{
778- struct search * s = container_of ( cl , struct search , cl );
778+ closure_type ( s , struct search , cl );
779779 struct bio * bio = & s -> bio .bio ;
780780
781781 /*
@@ -801,9 +801,9 @@ static void cached_dev_read_error(struct closure *cl)
801801 continue_at (cl , cached_dev_read_error_done , NULL );
802802}
803803
804- static void cached_dev_cache_miss_done ( struct closure * cl )
804+ static CLOSURE_CALLBACK ( cached_dev_cache_miss_done )
805805{
806- struct search * s = container_of ( cl , struct search , cl );
806+ closure_type ( s , struct search , cl );
807807 struct bcache_device * d = s -> d ;
808808
809809 if (s -> iop .replace_collision )
@@ -812,13 +812,13 @@ static void cached_dev_cache_miss_done(struct closure *cl)
812812 if (s -> iop .bio )
813813 bio_free_pages (s -> iop .bio );
814814
815- cached_dev_bio_complete (cl );
815+ cached_dev_bio_complete (& cl -> work );
816816 closure_put (& d -> cl );
817817}
818818
819- static void cached_dev_read_done ( struct closure * cl )
819+ static CLOSURE_CALLBACK ( cached_dev_read_done )
820820{
821- struct search * s = container_of ( cl , struct search , cl );
821+ closure_type ( s , struct search , cl );
822822 struct cached_dev * dc = container_of (s -> d , struct cached_dev , disk );
823823
824824 /*
@@ -858,9 +858,9 @@ static void cached_dev_read_done(struct closure *cl)
858858 continue_at (cl , cached_dev_cache_miss_done , NULL );
859859}
860860
861- static void cached_dev_read_done_bh ( struct closure * cl )
861+ static CLOSURE_CALLBACK ( cached_dev_read_done_bh )
862862{
863- struct search * s = container_of ( cl , struct search , cl );
863+ closure_type ( s , struct search , cl );
864864 struct cached_dev * dc = container_of (s -> d , struct cached_dev , disk );
865865
866866 bch_mark_cache_accounting (s -> iop .c , s -> d ,
@@ -955,13 +955,13 @@ static void cached_dev_read(struct cached_dev *dc, struct search *s)
955955
956956/* Process writes */
957957
958- static void cached_dev_write_complete ( struct closure * cl )
958+ static CLOSURE_CALLBACK ( cached_dev_write_complete )
959959{
960- struct search * s = container_of ( cl , struct search , cl );
960+ closure_type ( s , struct search , cl );
961961 struct cached_dev * dc = container_of (s -> d , struct cached_dev , disk );
962962
963963 up_read_non_owner (& dc -> writeback_lock );
964- cached_dev_bio_complete (cl );
964+ cached_dev_bio_complete (& cl -> work );
965965}
966966
967967static void cached_dev_write (struct cached_dev * dc , struct search * s )
@@ -1048,9 +1048,9 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s)
10481048 continue_at (cl , cached_dev_write_complete , NULL );
10491049}
10501050
1051- static void cached_dev_nodata ( struct closure * cl )
1051+ static CLOSURE_CALLBACK ( cached_dev_nodata )
10521052{
1053- struct search * s = container_of ( cl , struct search , cl );
1053+ closure_type ( s , struct search , cl );
10541054 struct bio * bio = & s -> bio .bio ;
10551055
10561056 if (s -> iop .flush_journal )
@@ -1265,9 +1265,9 @@ static int flash_dev_cache_miss(struct btree *b, struct search *s,
12651265 return MAP_CONTINUE ;
12661266}
12671267
1268- static void flash_dev_nodata ( struct closure * cl )
1268+ static CLOSURE_CALLBACK ( flash_dev_nodata )
12691269{
1270- struct search * s = container_of ( cl , struct search , cl );
1270+ closure_type ( s , struct search , cl );
12711271
12721272 if (s -> iop .flush_journal )
12731273 bch_journal_meta (s -> iop .c , cl );
0 commit comments