diff options
| author | Christoph Hellwig <hch@lst.de> | 2025-01-03 08:33:57 +0100 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2025-01-04 15:27:35 -0700 |
| commit | 6aeb4f836480617be472de767c4cb09c1060a067 (patch) | |
| tree | 3c8f7a90d542898614b1fbaa7b6f407045166e7c /drivers/target | |
| parent | c2398e6d5f16e15598d3a37e17107fea477e3f91 (diff) | |
| download | linux-6aeb4f836480617be472de767c4cb09c1060a067.tar.gz linux-6aeb4f836480617be472de767c4cb09c1060a067.tar.bz2 linux-6aeb4f836480617be472de767c4cb09c1060a067.zip | |
block: remove bio_add_pc_page
Lift bio_split_rw_at into blk_rq_append_bio so that it validates the
hardware limits. With this all passthrough callers can simply add
bio_add_page to build the bio and delay checking for exceeding of limits
to this point instead of doing it for each page.
While this looks like adding a new expensive loop over all bio_vecs,
blk_rq_append_bio is already doing that just to counter the number of
segments.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Link: https://lore.kernel.org/r/20250103073417.459715-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/target')
| -rw-r--r-- | drivers/target/target_core_pscsi.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 287ac5b0495f..f991cf759836 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c @@ -823,7 +823,6 @@ static sense_reason_t pscsi_map_sg(struct se_cmd *cmd, struct scatterlist *sgl, u32 sgl_nents, struct request *req) { - struct pscsi_dev_virt *pdv = PSCSI_DEV(cmd->se_dev); struct bio *bio = NULL; struct page *page; struct scatterlist *sg; @@ -871,12 +870,11 @@ new_bio: (rw) ? "rw" : "r", nr_vecs); } - pr_debug("PSCSI: Calling bio_add_pc_page() i: %d" + pr_debug("PSCSI: Calling bio_add_page() i: %d" " bio: %p page: %p len: %d off: %d\n", i, bio, page, len, off); - rc = bio_add_pc_page(pdv->pdv_sd->request_queue, - bio, page, bytes, off); + rc = bio_add_page(bio, page, bytes, off); pr_debug("PSCSI: bio->bi_vcnt: %d nr_vecs: %d\n", bio_segments(bio), nr_vecs); if (rc != bytes) { |
