diff options
author | Christoph Hellwig <hch@lst.de> | 2021-11-17 09:13:59 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-11-29 16:34:51 +0300 |
commit | 52fdbbcc83f35da90f857668acc387470ed84606 (patch) | |
tree | 6c510c8233ff95a3e44bd3f22abf4fd87af17b97 /block/blk-mq.c | |
parent | 06c8c691e2820077936e59ad334eb806e90b69eb (diff) | |
download | linux-52fdbbcc83f35da90f857668acc387470ed84606.tar.xz |
block: move blk_rq_init to blk-mq.c
blk_rq_init deals with a request structure, so move it to blk-mq.c
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20211117061404.331732-7-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index 812dac9ecb29..3217139d2e0b 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -328,6 +328,23 @@ void blk_mq_wake_waiters(struct request_queue *q) blk_mq_tag_wakeup_all(hctx->tags, true); } +void blk_rq_init(struct request_queue *q, struct request *rq) +{ + memset(rq, 0, sizeof(*rq)); + + INIT_LIST_HEAD(&rq->queuelist); + rq->q = q; + rq->__sector = (sector_t) -1; + INIT_HLIST_NODE(&rq->hash); + RB_CLEAR_NODE(&rq->rb_node); + rq->tag = BLK_MQ_NO_TAG; + rq->internal_tag = BLK_MQ_NO_TAG; + rq->start_time_ns = ktime_get_ns(); + rq->part = NULL; + blk_crypto_rq_set_defaults(rq); +} +EXPORT_SYMBOL(blk_rq_init); + static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data, struct blk_mq_tags *tags, unsigned int tag, u64 alloc_time_ns) { |