@@ -283,7 +283,7 @@ EXPORT_SYMBOL(blk_dump_rq_flags);
283283 * A block device may call blk_sync_queue to ensure that any
284284 * such activity is cancelled, thus allowing it to release resources
285285 * that the callbacks might use. The caller must already have made sure
286- * that its ->make_request_fn will not re-add plugging prior to calling
286+ * that its ->submit_bio will not re-add plugging prior to calling
287287 * this function.
288288 *
289289 * This function does not cancel any asynchronous activity arising
@@ -510,7 +510,7 @@ static void blk_timeout_work(struct work_struct *work)
510510{
511511}
512512
513- struct request_queue * __blk_alloc_queue (int node_id )
513+ struct request_queue * blk_alloc_queue (int node_id )
514514{
515515 struct request_queue * q ;
516516 int ret ;
@@ -575,6 +575,7 @@ struct request_queue *__blk_alloc_queue(int node_id)
575575
576576 blk_queue_dma_alignment (q , 511 );
577577 blk_set_default_limits (& q -> limits );
578+ q -> nr_requests = BLKDEV_MAX_RQ ;
578579
579580 return q ;
580581
@@ -592,21 +593,6 @@ struct request_queue *__blk_alloc_queue(int node_id)
592593 kmem_cache_free (blk_requestq_cachep , q );
593594 return NULL ;
594595}
595-
596- struct request_queue * blk_alloc_queue (make_request_fn make_request , int node_id )
597- {
598- struct request_queue * q ;
599-
600- if (WARN_ON_ONCE (!make_request ))
601- return NULL ;
602-
603- q = __blk_alloc_queue (node_id );
604- if (!q )
605- return NULL ;
606- q -> make_request_fn = make_request ;
607- q -> nr_requests = BLKDEV_MAX_RQ ;
608- return q ;
609- }
610596EXPORT_SYMBOL (blk_alloc_queue );
611597
612598/**
@@ -1088,15 +1074,15 @@ generic_make_request_checks(struct bio *bio)
10881074
10891075static blk_qc_t do_make_request (struct bio * bio )
10901076{
1091- struct request_queue * q = bio -> bi_disk -> queue ;
1077+ struct gendisk * disk = bio -> bi_disk ;
10921078 blk_qc_t ret = BLK_QC_T_NONE ;
10931079
10941080 if (blk_crypto_bio_prep (& bio )) {
1095- if (!q -> make_request_fn )
1096- return blk_mq_make_request ( q , bio );
1097- ret = q -> make_request_fn ( q , bio );
1081+ if (!disk -> fops -> submit_bio )
1082+ return blk_mq_submit_bio ( bio );
1083+ ret = disk -> fops -> submit_bio ( bio );
10981084 }
1099- blk_queue_exit (q );
1085+ blk_queue_exit (disk -> queue );
11001086 return ret ;
11011087}
11021088
@@ -1113,10 +1099,9 @@ blk_qc_t generic_make_request(struct bio *bio)
11131099{
11141100 /*
11151101 * bio_list_on_stack[0] contains bios submitted by the current
1116- * make_request_fn.
1117- * bio_list_on_stack[1] contains bios that were submitted before
1118- * the current make_request_fn, but that haven't been processed
1119- * yet.
1102+ * ->submit_bio.
1103+ * bio_list_on_stack[1] contains bios that were submitted before the
1104+ * current ->submit_bio_bio, but that haven't been processed yet.
11201105 */
11211106 struct bio_list bio_list_on_stack [2 ];
11221107 blk_qc_t ret = BLK_QC_T_NONE ;
@@ -1125,10 +1110,10 @@ blk_qc_t generic_make_request(struct bio *bio)
11251110 goto out ;
11261111
11271112 /*
1128- * We only want one ->make_request_fn to be active at a time, else
1113+ * We only want one ->submit_bio to be active at a time, else
11291114 * stack usage with stacked devices could be a problem. So use
11301115 * current->bio_list to keep a list of requests submited by a
1131- * make_request_fn function . current->bio_list is also used as a
1116+ * ->submit_bio method . current->bio_list is also used as a
11321117 * flag to say if generic_make_request is currently active in this
11331118 * task or not. If it is NULL, then no make_request is active. If
11341119 * it is non-NULL, then a make_request is active, and new requests
@@ -1146,12 +1131,12 @@ blk_qc_t generic_make_request(struct bio *bio)
11461131 * We pretend that we have just taken it off a longer list, so
11471132 * we assign bio_list to a pointer to the bio_list_on_stack,
11481133 * thus initialising the bio_list of new bios to be
1149- * added. ->make_request () may indeed add some more bios
1134+ * added. ->submit_bio () may indeed add some more bios
11501135 * through a recursive call to generic_make_request. If it
11511136 * did, we find a non-NULL value in bio_list and re-enter the loop
11521137 * from the top. In this case we really did just take the bio
11531138 * of the top of the list (no pretending) and so remove it from
1154- * bio_list, and call into ->make_request () again.
1139+ * bio_list, and call into ->submit_bio () again.
11551140 */
11561141 BUG_ON (bio -> bi_next );
11571142 bio_list_init (& bio_list_on_stack [0 ]);
@@ -1201,9 +1186,9 @@ EXPORT_SYMBOL(generic_make_request);
12011186 */
12021187blk_qc_t direct_make_request (struct bio * bio )
12031188{
1204- struct request_queue * q = bio -> bi_disk -> queue ;
1189+ struct gendisk * disk = bio -> bi_disk ;
12051190
1206- if (WARN_ON_ONCE (q -> make_request_fn )) {
1191+ if (WARN_ON_ONCE (! disk -> queue -> mq_ops )) {
12071192 bio_io_error (bio );
12081193 return BLK_QC_T_NONE ;
12091194 }
@@ -1212,10 +1197,10 @@ blk_qc_t direct_make_request(struct bio *bio)
12121197 if (unlikely (bio_queue_enter (bio )))
12131198 return BLK_QC_T_NONE ;
12141199 if (!blk_crypto_bio_prep (& bio )) {
1215- blk_queue_exit (q );
1200+ blk_queue_exit (disk -> queue );
12161201 return BLK_QC_T_NONE ;
12171202 }
1218- return blk_mq_make_request ( q , bio );
1203+ return blk_mq_submit_bio ( bio );
12191204}
12201205EXPORT_SYMBOL_GPL (direct_make_request );
12211206
0 commit comments