Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: cleanup for _blk/blk_rq_prep_clone

Both cmd and sense had been moved to scsi_request, so remove
the related comments to avoid confusion.

And as Bart suggested, move _blk_rq_prep_clone into the only
caller (blk_rq_prep_clone).

Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Guoqing Jiang and committed by
Jens Axboe
361301a2 fc4cc772

+10 -20
+10 -20
block/blk-core.c
··· 1581 1581 } 1582 1582 EXPORT_SYMBOL_GPL(blk_rq_unprep_clone); 1583 1583 1584 - /* 1585 - * Copy attributes of the original request to the clone request. 1586 - * The actual data parts (e.g. ->cmd, ->sense) are not copied. 1587 - */ 1588 - static void __blk_rq_prep_clone(struct request *dst, struct request *src) 1589 - { 1590 - dst->__sector = blk_rq_pos(src); 1591 - dst->__data_len = blk_rq_bytes(src); 1592 - if (src->rq_flags & RQF_SPECIAL_PAYLOAD) { 1593 - dst->rq_flags |= RQF_SPECIAL_PAYLOAD; 1594 - dst->special_vec = src->special_vec; 1595 - } 1596 - dst->nr_phys_segments = src->nr_phys_segments; 1597 - dst->ioprio = src->ioprio; 1598 - dst->extra_len = src->extra_len; 1599 - } 1600 - 1601 1584 /** 1602 1585 * blk_rq_prep_clone - Helper function to setup clone request 1603 1586 * @rq: the request to be setup ··· 1593 1610 * 1594 1611 * Description: 1595 1612 * Clones bios in @rq_src to @rq, and copies attributes of @rq_src to @rq. 1596 - * The actual data parts of @rq_src (e.g. ->cmd, ->sense) 1597 - * are not copied, and copying such parts is the caller's responsibility. 1598 1613 * Also, pages which the original bios are pointing to are not copied 1599 1614 * and the cloned bios just point same pages. 1600 1615 * So cloned bios must be completed before original bios, which means ··· 1623 1642 rq->bio = rq->biotail = bio; 1624 1643 } 1625 1644 1626 - __blk_rq_prep_clone(rq, rq_src); 1645 + /* Copy attributes of the original request to the clone request. */ 1646 + rq->__sector = blk_rq_pos(rq_src); 1647 + rq->__data_len = blk_rq_bytes(rq_src); 1648 + if (rq_src->rq_flags & RQF_SPECIAL_PAYLOAD) { 1649 + rq->rq_flags |= RQF_SPECIAL_PAYLOAD; 1650 + rq->special_vec = rq_src->special_vec; 1651 + } 1652 + rq->nr_phys_segments = rq_src->nr_phys_segments; 1653 + rq->ioprio = rq_src->ioprio; 1654 + rq->extra_len = rq_src->extra_len; 1627 1655 1628 1656 return 0; 1629 1657