From b4fcdb7349323ee8241338f716519f8b2d3bd97f Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 24 Jan 2022 16:05:44 +0300 Subject: [PATCH] scst: Port to Linux kernel v5.17 --- scst/include/backport.h | 21 +++++++++++++++------ scst/src/scst_lib.c | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 809d22062..b046c3720 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -202,15 +202,24 @@ blkdev_get_by_path(const char *path, fmode_t mode, void *holder) } #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0) /* - * See also commit 8eeed0b554b9 ("block: remove unnecessary argument from - * blk_execute_rq_nowait") # v5.12. + * See also commit b84ba30b6c7a ("block: remove the gendisk argument to + * blk_execute_rq") # v5.17. */ -static inline void blk_execute_rq_nowait_backport(struct gendisk *bd_disk, - struct request *rq, int at_head, rq_end_io_fn *done) +static inline +void blk_execute_rq_nowait_backport(struct request *rq, bool at_head, + rq_end_io_fn *done) { - blk_execute_rq_nowait(rq->q, bd_disk, rq, at_head, done); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) + /* + * See also commit 8eeed0b554b9 ("block: remove unnecessary argument from + * blk_execute_rq_nowait") # v5.12. + */ + blk_execute_rq_nowait(rq->q, NULL, rq, at_head, done); +#else + blk_execute_rq_nowait(NULL, rq, at_head, done); +#endif } #define blk_execute_rq_nowait blk_execute_rq_nowait_backport diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index a3b7d207a..868f982ff 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8844,7 +8844,7 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, rq->cmd_flags |= REQ_FAILFAST_MASK; #endif - blk_execute_rq_nowait(NULL, rq, + blk_execute_rq_nowait(rq, (cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE), scsi_end_async); out: return res;