mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
block: remove the write_hint field from struct request
The write_hint is only used for read/write requests, which must have a bio attached to them. Just use the bio field instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20241112170050.1612998-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
0b4ace9da5
commit
61952bb734
@ -867,9 +867,11 @@ static struct request *attempt_merge(struct request_queue *q,
|
|||||||
if (rq_data_dir(req) != rq_data_dir(next))
|
if (rq_data_dir(req) != rq_data_dir(next))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Don't merge requests with different write hints. */
|
if (req->bio && next->bio) {
|
||||||
if (req->write_hint != next->write_hint)
|
/* Don't merge requests with different write hints. */
|
||||||
return NULL;
|
if (req->bio->bi_write_hint != next->bio->bi_write_hint)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (req->ioprio != next->ioprio)
|
if (req->ioprio != next->ioprio)
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -1001,9 +1003,11 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio)
|
|||||||
if (!bio_crypt_rq_ctx_compatible(rq, bio))
|
if (!bio_crypt_rq_ctx_compatible(rq, bio))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
/* Don't merge requests with different write hints. */
|
if (rq->bio) {
|
||||||
if (rq->write_hint != bio->bi_write_hint)
|
/* Don't merge requests with different write hints. */
|
||||||
return false;
|
if (rq->bio->bi_write_hint != bio->bi_write_hint)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (rq->ioprio != bio_prio(bio))
|
if (rq->ioprio != bio_prio(bio))
|
||||||
return false;
|
return false;
|
||||||
|
@ -2660,7 +2660,6 @@ static void blk_mq_bio_to_request(struct request *rq, struct bio *bio,
|
|||||||
rq->cmd_flags |= REQ_FAILFAST_MASK;
|
rq->cmd_flags |= REQ_FAILFAST_MASK;
|
||||||
|
|
||||||
rq->__sector = bio->bi_iter.bi_sector;
|
rq->__sector = bio->bi_iter.bi_sector;
|
||||||
rq->write_hint = bio->bi_write_hint;
|
|
||||||
blk_rq_bio_prep(rq, bio, nr_segs);
|
blk_rq_bio_prep(rq, bio, nr_segs);
|
||||||
if (bio_integrity(bio))
|
if (bio_integrity(bio))
|
||||||
rq->nr_integrity_segments = blk_rq_count_integrity_sg(rq->q,
|
rq->nr_integrity_segments = blk_rq_count_integrity_sg(rq->q,
|
||||||
@ -3308,7 +3307,6 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
|
|||||||
}
|
}
|
||||||
rq->nr_phys_segments = rq_src->nr_phys_segments;
|
rq->nr_phys_segments = rq_src->nr_phys_segments;
|
||||||
rq->ioprio = rq_src->ioprio;
|
rq->ioprio = rq_src->ioprio;
|
||||||
rq->write_hint = rq_src->write_hint;
|
|
||||||
|
|
||||||
if (rq->bio && blk_crypto_rq_bio_prep(rq, rq->bio, gfp_mask) < 0)
|
if (rq->bio && blk_crypto_rq_bio_prep(rq, rq->bio, gfp_mask) < 0)
|
||||||
goto free_and_out;
|
goto free_and_out;
|
||||||
|
@ -1190,8 +1190,8 @@ static u8 sd_group_number(struct scsi_cmnd *cmd)
|
|||||||
if (!sdkp->rscs)
|
if (!sdkp->rscs)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return min3((u32)rq->write_hint, (u32)sdkp->permanent_stream_count,
|
return min3((u32)rq->bio->bi_write_hint,
|
||||||
0x3fu);
|
(u32)sdkp->permanent_stream_count, 0x3fu);
|
||||||
}
|
}
|
||||||
|
|
||||||
static blk_status_t sd_setup_rw32_cmnd(struct scsi_cmnd *cmd, bool write,
|
static blk_status_t sd_setup_rw32_cmnd(struct scsi_cmnd *cmd, bool write,
|
||||||
@ -1389,7 +1389,7 @@ static blk_status_t sd_setup_read_write_cmnd(struct scsi_cmnd *cmd)
|
|||||||
ret = sd_setup_rw16_cmnd(cmd, write, lba, nr_blocks,
|
ret = sd_setup_rw16_cmnd(cmd, write, lba, nr_blocks,
|
||||||
protect | fua, dld);
|
protect | fua, dld);
|
||||||
} else if ((nr_blocks > 0xff) || (lba > 0x1fffff) ||
|
} else if ((nr_blocks > 0xff) || (lba > 0x1fffff) ||
|
||||||
sdp->use_10_for_rw || protect || rq->write_hint) {
|
sdp->use_10_for_rw || protect || rq->bio->bi_write_hint) {
|
||||||
ret = sd_setup_rw10_cmnd(cmd, write, lba, nr_blocks,
|
ret = sd_setup_rw10_cmnd(cmd, write, lba, nr_blocks,
|
||||||
protect | fua);
|
protect | fua);
|
||||||
} else {
|
} else {
|
||||||
|
@ -156,7 +156,6 @@ struct request {
|
|||||||
struct blk_crypto_keyslot *crypt_keyslot;
|
struct blk_crypto_keyslot *crypt_keyslot;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
enum rw_hint write_hint;
|
|
||||||
unsigned short ioprio;
|
unsigned short ioprio;
|
||||||
|
|
||||||
enum mq_rq_state state;
|
enum mq_rq_state state;
|
||||||
|
Loading…
Reference in New Issue
Block a user