diff options
author | Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> | 2020-11-10 05:24:03 +0300 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2020-12-01 22:36:35 +0300 |
commit | 53ffabfd4ddb3a24c5603ae82eefb5537ecb5c20 (patch) | |
tree | d6483910c8dcd8b3d3b5aaf387df0944beab6ded /include/linux/blk-mq.h | |
parent | 47e9730c26a4a5d4eab2124d6bbeb94693e44b46 (diff) | |
download | linux-53ffabfd4ddb3a24c5603ae82eefb5537ecb5c20.tar.xz |
block: move blk_rq_bio_prep() to linux/blk-mq.h
This is a preparation patch to have minimal block layer request bio
append functionality in the context of the NVMeOF Passthru driver which
falls in the fast path and doesn't need calls from blk_rq_append_bio().
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'include/linux/blk-mq.h')
-rw-r--r-- | include/linux/blk-mq.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/linux/blk-mq.h b/include/linux/blk-mq.h index 794b2a33a2c3..e7482e6ad3ec 100644 --- a/include/linux/blk-mq.h +++ b/include/linux/blk-mq.h @@ -593,6 +593,18 @@ static inline void blk_mq_cleanup_rq(struct request *rq) rq->q->mq_ops->cleanup_rq(rq); } +static inline void blk_rq_bio_prep(struct request *rq, struct bio *bio, + unsigned int nr_segs) +{ + rq->nr_phys_segments = nr_segs; + rq->__data_len = bio->bi_iter.bi_size; + rq->bio = rq->biotail = bio; + rq->ioprio = bio_prio(bio); + + if (bio->bi_disk) + rq->rq_disk = bio->bi_disk; +} + blk_qc_t blk_mq_submit_bio(struct bio *bio); #endif |