From 805e3ffeb79a0f348f9c116e3a8709d5eb3912ad Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Sat, 23 Dec 2017 04:03:09 +0000 Subject: [PATCH] scst: fix pass-through on kernels 4.11 and 4.12 git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7287 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index c7c1241ec..947e34eaa 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -7957,7 +7957,11 @@ static struct request *blk_make_request(struct request_queue *q, if (IS_ERR(rq)) return rq; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) scsi_req_init(scsi_req(rq)); +#else + 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; @@ -8189,7 +8193,11 @@ static struct request *blk_map_kern_sg(struct request_queue *q, if (unlikely(!rq)) return ERR_PTR(-ENOMEM); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) scsi_req_init(scsi_req(rq)); +#else + 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; #endif