@@ -85,14 +85,13 @@ static void blk_mq_do_dispatch_sched(struct blk_mq_hw_ctx *hctx)
8585 do {
8686 struct request * rq ;
8787
88- if (e -> type -> ops .mq .has_work &&
89- !e -> type -> ops .mq .has_work (hctx ))
88+ if (e -> type -> ops .has_work && !e -> type -> ops .has_work (hctx ))
9089 break ;
9190
9291 if (!blk_mq_get_dispatch_budget (hctx ))
9392 break ;
9493
95- rq = e -> type -> ops .mq . dispatch_request (hctx );
94+ rq = e -> type -> ops .dispatch_request (hctx );
9695 if (!rq ) {
9796 blk_mq_put_dispatch_budget (hctx );
9897 break ;
@@ -163,7 +162,7 @@ void blk_mq_sched_dispatch_requests(struct blk_mq_hw_ctx *hctx)
163162{
164163 struct request_queue * q = hctx -> queue ;
165164 struct elevator_queue * e = q -> elevator ;
166- const bool has_sched_dispatch = e && e -> type -> ops .mq . dispatch_request ;
165+ const bool has_sched_dispatch = e && e -> type -> ops .dispatch_request ;
167166 LIST_HEAD (rq_list );
168167
169168 /* RCU or SRCU read lock is needed before checking quiesced flag */
@@ -314,9 +313,9 @@ bool __blk_mq_sched_bio_merge(struct request_queue *q, struct bio *bio)
314313 struct blk_mq_hw_ctx * hctx = blk_mq_map_queue (q , ctx -> cpu );
315314 bool ret = false;
316315
317- if (e && e -> type -> ops .mq . bio_merge ) {
316+ if (e && e -> type -> ops .bio_merge ) {
318317 blk_mq_put_ctx (ctx );
319- return e -> type -> ops .mq . bio_merge (hctx , bio );
318+ return e -> type -> ops .bio_merge (hctx , bio );
320319 }
321320
322321 if ((hctx -> flags & BLK_MQ_F_SHOULD_MERGE ) &&
@@ -380,11 +379,11 @@ void blk_mq_sched_insert_request(struct request *rq, bool at_head,
380379 if (blk_mq_sched_bypass_insert (hctx , !!e , rq ))
381380 goto run ;
382381
383- if (e && e -> type -> ops .mq . insert_requests ) {
382+ if (e && e -> type -> ops .insert_requests ) {
384383 LIST_HEAD (list );
385384
386385 list_add (& rq -> queuelist , & list );
387- e -> type -> ops .mq . insert_requests (hctx , & list , at_head );
386+ e -> type -> ops .insert_requests (hctx , & list , at_head );
388387 } else {
389388 spin_lock (& ctx -> lock );
390389 __blk_mq_insert_request (hctx , rq , at_head );
@@ -403,8 +402,8 @@ void blk_mq_sched_insert_requests(struct request_queue *q,
403402 struct blk_mq_hw_ctx * hctx = blk_mq_map_queue (q , ctx -> cpu );
404403 struct elevator_queue * e = hctx -> queue -> elevator ;
405404
406- if (e && e -> type -> ops .mq . insert_requests )
407- e -> type -> ops .mq . insert_requests (hctx , list , false);
405+ if (e && e -> type -> ops .insert_requests )
406+ e -> type -> ops .insert_requests (hctx , list , false);
408407 else {
409408 /*
410409 * try to issue requests directly if the hw queue isn't
@@ -489,15 +488,15 @@ int blk_mq_init_sched(struct request_queue *q, struct elevator_type *e)
489488 goto err ;
490489 }
491490
492- ret = e -> ops .mq . init_sched (q , e );
491+ ret = e -> ops .init_sched (q , e );
493492 if (ret )
494493 goto err ;
495494
496495 blk_mq_debugfs_register_sched (q );
497496
498497 queue_for_each_hw_ctx (q , hctx , i ) {
499- if (e -> ops .mq . init_hctx ) {
500- ret = e -> ops .mq . init_hctx (hctx , i );
498+ if (e -> ops .init_hctx ) {
499+ ret = e -> ops .init_hctx (hctx , i );
501500 if (ret ) {
502501 eq = q -> elevator ;
503502 blk_mq_exit_sched (q , eq );
@@ -523,14 +522,14 @@ void blk_mq_exit_sched(struct request_queue *q, struct elevator_queue *e)
523522
524523 queue_for_each_hw_ctx (q , hctx , i ) {
525524 blk_mq_debugfs_unregister_sched_hctx (hctx );
526- if (e -> type -> ops .mq . exit_hctx && hctx -> sched_data ) {
527- e -> type -> ops .mq . exit_hctx (hctx , i );
525+ if (e -> type -> ops .exit_hctx && hctx -> sched_data ) {
526+ e -> type -> ops .exit_hctx (hctx , i );
528527 hctx -> sched_data = NULL ;
529528 }
530529 }
531530 blk_mq_debugfs_unregister_sched (q );
532- if (e -> type -> ops .mq . exit_sched )
533- e -> type -> ops .mq . exit_sched (e );
531+ if (e -> type -> ops .exit_sched )
532+ e -> type -> ops .exit_sched (e );
534533 blk_mq_sched_tags_teardown (q );
535534 q -> elevator = NULL ;
536535}
0 commit comments