diff options
Diffstat (limited to 'block/blk-sysfs.c')
-rw-r--r-- | block/blk-sysfs.c | 36 |
1 files changed, 9 insertions, 27 deletions
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c index 1b82ccfde3fe..d4b1b84ba8ca 100644 --- a/block/blk-sysfs.c +++ b/block/blk-sysfs.c | |||
@@ -68,7 +68,7 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count) | |||
68 | unsigned long nr; | 68 | unsigned long nr; |
69 | int ret, err; | 69 | int ret, err; |
70 | 70 | ||
71 | if (!q->request_fn && !q->mq_ops) | 71 | if (!q->mq_ops) |
72 | return -EINVAL; | 72 | return -EINVAL; |
73 | 73 | ||
74 | ret = queue_var_store(&nr, page, count); | 74 | ret = queue_var_store(&nr, page, count); |
@@ -78,11 +78,7 @@ queue_requests_store(struct request_queue *q, const char *page, size_t count) | |||
78 | if (nr < BLKDEV_MIN_RQ) | 78 | if (nr < BLKDEV_MIN_RQ) |
79 | nr = BLKDEV_MIN_RQ; | 79 | nr = BLKDEV_MIN_RQ; |
80 | 80 | ||
81 | if (q->request_fn) | 81 | err = blk_mq_update_nr_requests(q, nr); |
82 | err = blk_update_nr_requests(q, nr); | ||
83 | else | ||
84 | err = blk_mq_update_nr_requests(q, nr); | ||
85 | |||
86 | if (err) | 82 | if (err) |
87 | return err; | 83 | return err; |
88 | 84 | ||
@@ -463,20 +459,14 @@ static ssize_t queue_wb_lat_store(struct request_queue *q, const char *page, | |||
463 | * ends up either enabling or disabling wbt completely. We can't | 459 | * ends up either enabling or disabling wbt completely. We can't |
464 | * have IO inflight if that happens. | 460 | * have IO inflight if that happens. |
465 | */ | 461 | */ |
466 | if (q->mq_ops) { | 462 | blk_mq_freeze_queue(q); |
467 | blk_mq_freeze_queue(q); | 463 | blk_mq_quiesce_queue(q); |
468 | blk_mq_quiesce_queue(q); | ||
469 | } else | ||
470 | blk_queue_bypass_start(q); | ||
471 | 464 | ||
472 | wbt_set_min_lat(q, val); | 465 | wbt_set_min_lat(q, val); |
473 | wbt_update_limits(q); | 466 | wbt_update_limits(q); |
474 | 467 | ||
475 | if (q->mq_ops) { | 468 | blk_mq_unquiesce_queue(q); |
476 | blk_mq_unquiesce_queue(q); | 469 | blk_mq_unfreeze_queue(q); |
477 | blk_mq_unfreeze_queue(q); | ||
478 | } else | ||
479 | blk_queue_bypass_end(q); | ||
480 | 470 | ||
481 | return count; | 471 | return count; |
482 | } | 472 | } |
@@ -847,17 +837,10 @@ static void __blk_release_queue(struct work_struct *work) | |||
847 | 837 | ||
848 | blk_free_queue_stats(q->stats); | 838 | blk_free_queue_stats(q->stats); |
849 | 839 | ||
850 | blk_exit_rl(q, &q->root_rl); | ||
851 | |||
852 | blk_queue_free_zone_bitmaps(q); | 840 | blk_queue_free_zone_bitmaps(q); |
853 | 841 | ||
854 | if (!q->mq_ops) { | 842 | if (q->mq_ops) |
855 | if (q->exit_rq_fn) | ||
856 | q->exit_rq_fn(q, q->fq->flush_rq); | ||
857 | blk_free_flush_queue(q->fq); | ||
858 | } else { | ||
859 | blk_mq_release(q); | 843 | blk_mq_release(q); |
860 | } | ||
861 | 844 | ||
862 | blk_trace_shutdown(q); | 845 | blk_trace_shutdown(q); |
863 | 846 | ||
@@ -920,7 +903,6 @@ int blk_register_queue(struct gendisk *disk) | |||
920 | if (!blk_queue_init_done(q)) { | 903 | if (!blk_queue_init_done(q)) { |
921 | queue_flag_set_unlocked(QUEUE_FLAG_INIT_DONE, q); | 904 | queue_flag_set_unlocked(QUEUE_FLAG_INIT_DONE, q); |
922 | percpu_ref_switch_to_percpu(&q->q_usage_counter); | 905 | percpu_ref_switch_to_percpu(&q->q_usage_counter); |
923 | blk_queue_bypass_end(q); | ||
924 | } | 906 | } |
925 | 907 | ||
926 | ret = blk_trace_init_sysfs(dev); | 908 | ret = blk_trace_init_sysfs(dev); |
@@ -947,7 +929,7 @@ int blk_register_queue(struct gendisk *disk) | |||
947 | 929 | ||
948 | blk_throtl_register_queue(q); | 930 | blk_throtl_register_queue(q); |
949 | 931 | ||
950 | if (q->request_fn || (q->mq_ops && q->elevator)) { | 932 | if ((q->mq_ops && q->elevator)) { |
951 | ret = elv_register_queue(q); | 933 | ret = elv_register_queue(q); |
952 | if (ret) { | 934 | if (ret) { |
953 | mutex_unlock(&q->sysfs_lock); | 935 | mutex_unlock(&q->sysfs_lock); |
@@ -1005,7 +987,7 @@ void blk_unregister_queue(struct gendisk *disk) | |||
1005 | blk_trace_remove_sysfs(disk_to_dev(disk)); | 987 | blk_trace_remove_sysfs(disk_to_dev(disk)); |
1006 | 988 | ||
1007 | mutex_lock(&q->sysfs_lock); | 989 | mutex_lock(&q->sysfs_lock); |
1008 | if (q->request_fn || (q->mq_ops && q->elevator)) | 990 | if (q->mq_ops && q->elevator) |
1009 | elv_unregister_queue(q); | 991 | elv_unregister_queue(q); |
1010 | mutex_unlock(&q->sysfs_lock); | 992 | mutex_unlock(&q->sysfs_lock); |
1011 | 993 | ||