diff options
author | Jens Axboe <axboe@kernel.dk> | 2018-10-12 10:03:14 -0600 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2018-10-14 12:47:52 -0600 |
commit | 3582dd291788e9441c3ba9047e55089edb98da5c (patch) | |
tree | 8500bb8ba0ff66fc3bb5d3ffb1bd8bed66f73d3c /drivers/block/aoe/aoedev.c | |
parent | e01ad46d53b59720c6ae69963ee1756506954c85 (diff) | |
download | linux-3582dd291788e9441c3ba9047e55089edb98da5c.tar.gz linux-3582dd291788e9441c3ba9047e55089edb98da5c.tar.bz2 linux-3582dd291788e9441c3ba9047e55089edb98da5c.zip |
aoe: convert aoeblk to blk-mq
Straight forward conversion - instead of rewriting the internal buffer
retrieval logic, just replace the previous elevator peeking with an
internal list of requests.
Reviewed-by: "Ed L. Cashin" <ed.cashin@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/aoe/aoedev.c')
-rw-r--r-- | drivers/block/aoe/aoedev.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index f29a140cdbc1..9063f8efbd3b 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c @@ -5,7 +5,7 @@ */ #include <linux/hdreg.h> -#include <linux/blkdev.h> +#include <linux/blk-mq.h> #include <linux/netdevice.h> #include <linux/delay.h> #include <linux/slab.h> @@ -197,7 +197,6 @@ aoedev_downdev(struct aoedev *d) { struct aoetgt *t, **tt, **te; struct list_head *head, *pos, *nx; - struct request *rq; int i; d->flags &= ~DEVFL_UP; @@ -225,10 +224,11 @@ aoedev_downdev(struct aoedev *d) /* fast fail all pending I/O */ if (d->blkq) { - while ((rq = blk_peek_request(d->blkq))) { - blk_start_request(rq); - aoe_end_request(d, rq, 1); - } + /* UP is cleared, freeze+quiesce to insure all are errored */ + blk_mq_freeze_queue(d->blkq); + blk_mq_quiesce_queue(d->blkq); + blk_mq_unquiesce_queue(d->blkq); + blk_mq_unfreeze_queue(d->blkq); } if (d->gd) @@ -277,6 +277,7 @@ freedev(struct aoedev *d) aoedisk_rm_debugfs(d); del_gendisk(d->gd); put_disk(d->gd); + blk_mq_free_tag_set(&d->tag_set); blk_cleanup_queue(d->blkq); } t = d->targets; @@ -463,6 +464,7 @@ aoedev_by_aoeaddr(ulong maj, int min, int do_alloc) d->ntargets = NTARGETS; INIT_WORK(&d->work, aoecmd_sleepwork); spin_lock_init(&d->lock); + INIT_LIST_HEAD(&d->rq_list); skb_queue_head_init(&d->skbpool); timer_setup(&d->timer, dummy_timer, 0); d->timer.expires = jiffies + HZ; |