aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig2020-07-01 10:59:47 +0200
committerJens Axboe2020-07-01 07:27:24 -0600
commit5a6c35f9af416114588298aa7a90b15bbed15a41 (patch)
treed28331c5a7ff99ba8d14f275a9aff9702268a984
parentff93ea0ce7636345df1bf77a2be09dbb59f4517e (diff)
block: remove direct_make_request
Now that submit_bio_noacct has a decent blk-mq fast path there is no more need for this bypass. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-core.c28
-rw-r--r--drivers/md/dm.c5
-rw-r--r--drivers/nvme/host/multipath.c2
-rw-r--r--include/linux/blkdev.h1
4 files changed, 2 insertions, 34 deletions
diff --git a/block/blk-core.c b/block/blk-core.c
index 2ff166f0d24e..bf882b8d8445 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1212,34 +1212,6 @@ blk_qc_t submit_bio_noacct(struct bio *bio)
EXPORT_SYMBOL(submit_bio_noacct);
/**
- * direct_make_request - hand a buffer directly to its device driver for I/O
- * @bio: The bio describing the location in memory and on the device.
- *
- * This function behaves like submit_bio_noacct(), but does not protect
- * against recursion. Must only be used if the called driver is known
- * to be blk-mq based.
- */
-blk_qc_t direct_make_request(struct bio *bio)
-{
- struct gendisk *disk = bio->bi_disk;
-
- if (WARN_ON_ONCE(!disk->queue->mq_ops)) {
- bio_io_error(bio);
- return BLK_QC_T_NONE;
- }
- if (!submit_bio_checks(bio))
- return BLK_QC_T_NONE;
- if (unlikely(bio_queue_enter(bio)))
- return BLK_QC_T_NONE;
- if (!blk_crypto_bio_prep(&bio)) {
- blk_queue_exit(disk->queue);
- return BLK_QC_T_NONE;
- }
- return blk_mq_submit_bio(bio);
-}
-EXPORT_SYMBOL_GPL(direct_make_request);
-
-/**
* submit_bio - submit a bio to the block device layer for I/O
* @bio: The &struct bio which describes the I/O
*
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index b32b539dbace..2cb33896198c 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1302,10 +1302,7 @@ static blk_qc_t __map_bio(struct dm_target_io *tio)
/* the bio has been remapped so dispatch it */
trace_block_bio_remap(clone->bi_disk->queue, clone,
bio_dev(io->orig_bio), sector);
- if (md->type == DM_TYPE_NVME_BIO_BASED)
- ret = direct_make_request(clone);
- else
- ret = submit_bio_noacct(clone);
+ ret = submit_bio_noacct(clone);
break;
case DM_MAPIO_KILL:
free_tio(tio);
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index f07fa47c251d..a986ac52c4cc 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -314,7 +314,7 @@ blk_qc_t nvme_ns_head_submit_bio(struct bio *bio)
trace_block_bio_remap(bio->bi_disk->queue, bio,
disk_devt(ns->head->disk),
bio->bi_iter.bi_sector);
- ret = direct_make_request(bio);
+ ret = submit_bio_noacct(bio);
} else if (nvme_available_path(head)) {
dev_warn_ratelimited(dev, "no usable path - requeuing I/O\n");
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index b73cfa6a5141..1cc913ffdbe2 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -853,7 +853,6 @@ static inline void rq_flush_dcache_pages(struct request *rq)
extern int blk_register_queue(struct gendisk *disk);
extern void blk_unregister_queue(struct gendisk *disk);
blk_qc_t submit_bio_noacct(struct bio *bio);
-extern blk_qc_t direct_make_request(struct bio *bio);
extern void blk_rq_init(struct request_queue *q, struct request *rq);
extern void blk_put_request(struct request *);
extern struct request *blk_get_request(struct request_queue *, unsigned int op,