From 20ec24e0768cc0931be6498ccf43845cdd617235 Mon Sep 17 00:00:00 2001 From: Gleb Chesnokov Date: Mon, 17 Oct 2022 12:23:02 +0300 Subject: [PATCH] scst_lib: Port to Linux kernel v6.1 Support for the following block layer changes in the Linux kernel v6.1: - de671d6116b5 ("block: change request end_io handler to pass back a return value") --- scst/src/scst_lib.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 0bdc78e09..9ce87a7ee 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8474,7 +8474,18 @@ out: !defined(CONFIG_SUSE_KERNEL) static void scsi_end_async(struct request *req, int error) #else -static void scsi_end_async(struct request *req, blk_status_t error) + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) +/* + * See also commit de671d6116b5 ("block: change request end_io handler to pass + * back a return value") # v6.1. + */ +#define RQ_END_IO_RET enum rq_end_io_ret +#else +#define RQ_END_IO_RET void +#endif + +static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) #endif { struct scsi_io_context *sioc = req->end_io_data; @@ -8520,6 +8531,7 @@ static void scsi_end_async(struct request *req, blk_status_t error) kmem_cache_free(scsi_io_context_cache, sioc); +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 21, 0) && \ (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 8) /* See also commit 92bc5a24844a ("block: remove __blk_put_request()") */ @@ -8530,6 +8542,9 @@ static void scsi_end_async(struct request *req, blk_status_t error) blk_mq_free_request(req); #endif return; +#else + return RQ_END_IO_FREE; +#endif } /**