scst: Fix SCSI pass-through for kernel version v4.11 and later

See also trunk r7153.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7249 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2017-10-09 18:15:00 +00:00
parent 16fe64bc13
commit 47b7da25aa
+11 -1
View File
@@ -7866,6 +7866,10 @@ static struct request *blk_make_request(struct request_queue *q,
scsi_req_init(scsi_req(rq));
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
scsi_req_init(rq);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
rq->cmd_flags = bio_data_dir(bio) == READ ? REQ_OP_SCSI_IN :
REQ_OP_SCSI_OUT;
#else
blk_rq_set_block_pc(rq);
#endif
@@ -8042,6 +8046,9 @@ static struct request *__blk_map_kern_sg(struct request_queue *q,
*/
rq->cmd_type = REQ_TYPE_BLOCK_PC;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
rq->cmd_flags = reading ? REQ_OP_SCSI_IN : REQ_OP_SCSI_OUT;
#endif
if (bw != NULL) {
atomic_set(&bw->bios_inflight, bios);
@@ -8095,8 +8102,11 @@ static struct request *blk_map_kern_sg(struct request_queue *q,
scsi_req_init(scsi_req(rq));
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
scsi_req_init(rq);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
rq->cmd_flags = reading ? REQ_OP_SCSI_IN : REQ_OP_SCSI_OUT;
#else
rq->cmd_type = REQ_TYPE_BLOCK_PC;
blk_rq_set_block_pc(rq);
#endif
goto out;
}