Init SCSI request properly on newer kernels

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-08-05 11:51:17 +02:00
parent 5603a77302
commit ed6b5f60ee

View File

@ -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 <linux/blk-mq.h>
#include <scsi/scsi_request.h>
#include <scsi/scsi_cmnd.h>
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