projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
adff215
)
blk-mq: move queue_is_mq out of blk_mq_cancel_work_sync
author
Jinlong Chen
<nickyc975@zju.edu.cn>
Sun, 30 Oct 2022 09:47:30 +0000
(17:47 +0800)
committer
Jens Axboe
<axboe@kernel.dk>
Mon, 31 Oct 2022 13:27:54 +0000
(07:27 -0600)
The only caller that needs queue_is_mq check is del_gendisk, so move the
check into it.
Signed-off-by: Jinlong Chen <nickyc975@zju.edu.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link:
https://lore.kernel.org/r/20221030094730.1275463-1-nickyc975@zju.edu.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-mq.c
patch
|
blob
|
history
block/genhd.c
patch
|
blob
|
history
diff --git
a/block/blk-mq.c
b/block/blk-mq.c
index 060c8cca4b244034aac04166e4ba7e4f6f1f319e..bcb402f9bff6569e055da65b12db845b0f115396 100644
(file)
--- a/
block/blk-mq.c
+++ b/
block/blk-mq.c
@@
-4883,15
+4883,13
@@
EXPORT_SYMBOL(blk_mq_rq_cpu);
void blk_mq_cancel_work_sync(struct request_queue *q)
{
- if (queue_is_mq(q)) {
- struct blk_mq_hw_ctx *hctx;
- unsigned long i;
+ struct blk_mq_hw_ctx *hctx;
+ unsigned long i;
-
cancel_delayed_work_sync(&q->requeue_work);
+ cancel_delayed_work_sync(&q->requeue_work);
- queue_for_each_hw_ctx(q, hctx, i)
- cancel_delayed_work_sync(&hctx->run_work);
- }
+ queue_for_each_hw_ctx(q, hctx, i)
+ cancel_delayed_work_sync(&hctx->run_work);
}
static int __init blk_mq_init(void)
diff --git
a/block/genhd.c
b/block/genhd.c
index 17b33c62423dfbe9233c97a6f79848d1283c7199..493b93faee9c882fa2e873f23a4a90794c93df5e 100644
(file)
--- a/
block/genhd.c
+++ b/
block/genhd.c
@@
-638,7
+638,9
@@
void del_gendisk(struct gendisk *disk)
blk_sync_queue(q);
blk_flush_integrity();
- blk_mq_cancel_work_sync(q);
+
+ if (queue_is_mq(q))
+ blk_mq_cancel_work_sync(q);
blk_mq_quiesce_queue(q);
if (q->elevator) {