diff options
author | Jens Axboe <axboe@fb.com> | 2017-02-17 14:08:19 -0700 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2017-02-17 14:08:19 -0700 |
commit | 818551e2b2c662a1b26de6b4f7d6b8411a838d18 (patch) | |
tree | f38b4c951df4d33db81ae7b7765a56bce491c2a8 /drivers/scsi/sr.c | |
parent | 6010720da8aab51f33beee63b73cf88016e9b250 (diff) | |
parent | 7520872c0cf4d3df6d74242c6edfb9e70a47df4d (diff) | |
download | linux-818551e2b2c662a1b26de6b4f7d6b8411a838d18.tar.bz2 |
Merge branch 'for-4.11/next' into for-4.11/linus-merge
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/scsi/sr.c')
-rw-r--r-- | drivers/scsi/sr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c index 013bfe049a48..0b29b9329b1c 100644 --- a/drivers/scsi/sr.c +++ b/drivers/scsi/sr.c @@ -437,14 +437,17 @@ static int sr_init_command(struct scsi_cmnd *SCpnt) goto out; } - if (rq_data_dir(rq) == WRITE) { + switch (req_op(rq)) { + case REQ_OP_WRITE: if (!cd->writeable) goto out; SCpnt->cmnd[0] = WRITE_10; cd->cdi.media_written = 1; - } else if (rq_data_dir(rq) == READ) { + break; + case REQ_OP_READ: SCpnt->cmnd[0] = READ_10; - } else { + break; + default: blk_dump_rq_flags(rq, "Unknown sr command"); goto out; } |