From ed6b5f60eee36a145ab41f1e2d75aff20a1f903f Mon Sep 17 00:00:00 2001 From: Robert Baldyga Date: Mon, 5 Aug 2019 11:51:17 +0200 Subject: [PATCH] Init SCSI request properly on newer kernels Signed-off-by: Robert Baldyga --- configure.d/1_block_pc.conf | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/configure.d/1_block_pc.conf b/configure.d/1_block_pc.conf index d12e27e..9b8d939 100644 --- a/configure.d/1_block_pc.conf +++ b/configure.d/1_block_pc.conf @@ -20,11 +20,22 @@ check() { apply() { case "$1" in "1") - add_define "cas_blk_rq_set_block_pc(rq) \\ - blk_rq_set_block_pc(rq)" ;; + add_function " + static inline void cas_blk_rq_set_block_pc(struct request *rq) + { + blk_rq_set_block_pc(rq); + }" ;; "2") - add_define "cas_blk_rq_set_block_pc(rq) \\ - {}" ;; + add_function " + #include + #include + #include + static inline void cas_blk_rq_set_block_pc(struct request *rq) + { + struct scsi_cmnd *cmd = blk_mq_rq_to_pdu(rq); + + scsi_req_init(&cmd->req); + }" ;; *) exit 1 esac