Skip to content

Commit da6269d

Browse files
Christoph Hellwigaxboe
authored andcommitted
block: remove REQ_OP_SCSI_{IN,OUT}
With the legacy IDE driver gone drivers now use either REQ_OP_DRV_* or REQ_OP_SCSI_*, so unify the two concepts of passthrough requests into a single one. Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 5ec780a commit da6269d

14 files changed

Lines changed: 19 additions & 51 deletions

File tree

block/blk-core.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,6 @@ static const char *const blk_op_name[] = {
142142
REQ_OP_NAME(ZONE_APPEND),
143143
REQ_OP_NAME(WRITE_SAME),
144144
REQ_OP_NAME(WRITE_ZEROES),
145-
REQ_OP_NAME(SCSI_IN),
146-
REQ_OP_NAME(SCSI_OUT),
147145
REQ_OP_NAME(DRV_IN),
148146
REQ_OP_NAME(DRV_OUT),
149147
};

block/bsg-lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static int bsg_transport_fill_hdr(struct request *rq, struct sg_io_v4 *hdr,
4545
return PTR_ERR(job->request);
4646

4747
if (hdr->dout_xfer_len && hdr->din_xfer_len) {
48-
job->bidi_rq = blk_get_request(rq->q, REQ_OP_SCSI_IN, 0);
48+
job->bidi_rq = blk_get_request(rq->q, REQ_OP_DRV_IN, 0);
4949
if (IS_ERR(job->bidi_rq)) {
5050
ret = PTR_ERR(job->bidi_rq);
5151
goto out;

block/bsg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int bsg_sg_io(struct request_queue *q, fmode_t mode, void __user *uarg)
152152
return ret;
153153

154154
rq = blk_get_request(q, hdr.dout_xfer_len ?
155-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
155+
REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
156156
if (IS_ERR(rq))
157157
return PTR_ERR(rq);
158158

block/scsi_ioctl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static int sg_io(struct request_queue *q, struct gendisk *bd_disk,
311311
at_head = 1;
312312

313313
ret = -ENOMEM;
314-
rq = blk_get_request(q, writing ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
314+
rq = blk_get_request(q, writing ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
315315
if (IS_ERR(rq))
316316
return PTR_ERR(rq);
317317
req = scsi_req(rq);
@@ -433,7 +433,7 @@ int sg_scsi_ioctl(struct request_queue *q, struct gendisk *disk, fmode_t mode,
433433

434434
}
435435

436-
rq = blk_get_request(q, in_len ? REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
436+
rq = blk_get_request(q, in_len ? REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
437437
if (IS_ERR(rq)) {
438438
err = PTR_ERR(rq);
439439
goto error_free_buffer;
@@ -521,7 +521,7 @@ static int __blk_send_generic(struct request_queue *q, struct gendisk *bd_disk,
521521
struct request *rq;
522522
int err;
523523

524-
rq = blk_get_request(q, REQ_OP_SCSI_OUT, 0);
524+
rq = blk_get_request(q, REQ_OP_DRV_OUT, 0);
525525
if (IS_ERR(rq))
526526
return PTR_ERR(rq);
527527
rq->timeout = BLK_DEFAULT_SG_TIMEOUT;

drivers/block/pktcdvd.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ static int pkt_generic_packet(struct pktcdvd_device *pd, struct packet_command *
704704
int ret = 0;
705705

706706
rq = blk_get_request(q, (cgc->data_direction == CGC_DATA_WRITE) ?
707-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
707+
REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
708708
if (IS_ERR(rq))
709709
return PTR_ERR(rq);
710710

drivers/cdrom/cdrom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,7 @@ static int cdrom_read_cdda_bpc(struct cdrom_device_info *cdi, __u8 __user *ubuf,
21862186

21872187
len = nr * CD_FRAMESIZE_RAW;
21882188

2189-
rq = blk_get_request(q, REQ_OP_SCSI_IN, 0);
2189+
rq = blk_get_request(q, REQ_OP_DRV_IN, 0);
21902190
if (IS_ERR(rq)) {
21912191
ret = PTR_ERR(rq);
21922192
break;

drivers/scsi/scsi_error.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,7 @@ static void scsi_eh_lock_door(struct scsi_device *sdev)
20112011
struct request *req;
20122012
struct scsi_request *rq;
20132013

2014-
req = blk_get_request(sdev->request_queue, REQ_OP_SCSI_IN, 0);
2014+
req = blk_get_request(sdev->request_queue, REQ_OP_DRV_IN, 0);
20152015
if (IS_ERR(req))
20162016
return;
20172017
rq = scsi_req(req);

drivers/scsi/scsi_lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd,
215215

216216
req = blk_get_request(sdev->request_queue,
217217
data_direction == DMA_TO_DEVICE ?
218-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN,
218+
REQ_OP_DRV_OUT : REQ_OP_DRV_IN,
219219
rq_flags & RQF_PM ? BLK_MQ_REQ_PM : 0);
220220
if (IS_ERR(req))
221221
return ret;
@@ -540,7 +540,7 @@ static bool scsi_end_request(struct request *req, blk_status_t error,
540540
if (blk_queue_add_random(q))
541541
add_disk_randomness(req->rq_disk);
542542

543-
if (!blk_rq_is_scsi(req)) {
543+
if (!blk_rq_is_passthrough(req)) {
544544
WARN_ON_ONCE(!(cmd->flags & SCMD_INITIALIZED));
545545
cmd->flags &= ~SCMD_INITIALIZED;
546546
}
@@ -1115,7 +1115,7 @@ void scsi_init_command(struct scsi_device *dev, struct scsi_cmnd *cmd)
11151115
bool in_flight;
11161116
int budget_token = cmd->budget_token;
11171117

1118-
if (!blk_rq_is_scsi(rq) && !(flags & SCMD_INITIALIZED)) {
1118+
if (!blk_rq_is_passthrough(rq) && !(flags & SCMD_INITIALIZED)) {
11191119
flags |= SCMD_INITIALIZED;
11201120
scsi_initialize_rq(rq);
11211121
}
@@ -1556,7 +1556,7 @@ static blk_status_t scsi_prepare_cmd(struct request *req)
15561556
* Special handling for passthrough commands, which don't go to the ULP
15571557
* at all:
15581558
*/
1559-
if (blk_rq_is_scsi(req))
1559+
if (blk_rq_is_passthrough(req))
15601560
return scsi_setup_scsi_cmnd(sdev, req);
15611561

15621562
if (sdev->handler && sdev->handler->prep_fn) {

drivers/scsi/sg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ sg_start_req(Sg_request *srp, unsigned char *cmd)
17561756
* not expect an EWOULDBLOCK from this condition.
17571757
*/
17581758
rq = blk_get_request(q, hp->dxfer_direction == SG_DXFER_TO_DEV ?
1759-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
1759+
REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
17601760
if (IS_ERR(rq)) {
17611761
kfree(long_cmdp);
17621762
return PTR_ERR(rq);

drivers/scsi/st.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ static int st_scsi_execute(struct st_request *SRpnt, const unsigned char *cmd,
549549

550550
req = blk_get_request(SRpnt->stp->device->request_queue,
551551
data_direction == DMA_TO_DEVICE ?
552-
REQ_OP_SCSI_OUT : REQ_OP_SCSI_IN, 0);
552+
REQ_OP_DRV_OUT : REQ_OP_DRV_IN, 0);
553553
if (IS_ERR(req))
554554
return DRIVER_ERROR << 24;
555555
rq = scsi_req(req);

0 commit comments

Comments
 (0)