From: Gleb C. <lna...@ya...> - 2023-05-10 10:43:03
|
Commit: 28e8d31 GitHub URL: https://github.com/SCST-project/scst/commit/28e8d31f86e4f4898457d25fedc63df82a1e7a3c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst: Unbreak the RHEL 9.2 build See also PR https://github.com/SCST-project/scst/pull/145. Modified Paths: -------------- iscsi-scst/include/iscsi_scst.h | 10 +++++++++- qla2x00t-32gbit/qla_os.c | 8 +++++--- scst/src/dev_handlers/scst_vdisk.c | 8 ++++++-- scst/src/scst_lib.c | 12 ++++++++---- scst_local/scst_local.c | 8 ++++++-- 5 files changed, 34 insertions(+), 12 deletions(-) =================================================================== diff --git a/iscsi-scst/include/iscsi_scst.h b/iscsi-scst/include/iscsi_scst.h index 486c128..985621c 100644 --- a/iscsi-scst/include/iscsi_scst.h +++ b/iscsi-scst/include/iscsi_scst.h @@ -20,6 +20,12 @@ #include <linux/uaccess.h> /* mm_segment_t */ #include <linux/version.h> +#ifdef INSIDE_KERNEL_TREE +#include <scst/backport.h> +#else +#include "backport.h" +#endif + /* <asm/uaccess.h> */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) @@ -33,7 +39,9 @@ * to write kernel code that is compatible with all kernel versions. */ -#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 2)) /* * Backport mm_segment_t to save compatibility with older kernel versions. * diff --git a/qla2x00t-32gbit/qla_os.c b/qla2x00t-32gbit/qla_os.c index 302ae70..16917bc 100644 --- a/qla2x00t-32gbit/qla_os.c +++ b/qla2x00t-32gbit/qla_os.c @@ -375,14 +375,16 @@ static void qla2x00_clear_drv_active(struct qla_hw_data *); static void qla2x00_free_device(scsi_qla_host_t *); #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0) -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) /* * See also commit a4e1d0b76e7b ("block: Change the return type of * blk_mq_map_queues() into void") # v6.1. */ -#define MAP_QUEUES_RET void -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define MAP_QUEUES_RET int +#else +#define MAP_QUEUES_RET void #endif static MAP_QUEUES_RET qla2xxx_map_queues(struct Scsi_Host *shost); diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index 85a3931..54fbc70 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -3157,7 +3157,9 @@ struct bio_vec *vdisk_map_pages_to_bvec(struct bio_vec *bvec, struct page *page, } static void fileio_async_complete(struct kiocb *iocb, long ret -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) , long ret2 #endif ) @@ -3267,7 +3269,9 @@ static enum compl_status_e fileio_exec_async(struct vdisk_cmd_params *p) if (p->async.bvec != p->async.small_bvec) kfree(p->async.bvec); if (ret != -EIOCBQUEUED) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) fileio_async_complete(iocb, ret, 0); #else fileio_async_complete(iocb, ret); diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 29f1744..7adc568 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8560,14 +8560,16 @@ out: static void scsi_end_async(struct request *req, int error) #else -#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 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define RQ_END_IO_RET void +#else +#define RQ_END_IO_RET enum rq_end_io_ret #endif static RQ_END_IO_RET scsi_end_async(struct request *req, blk_status_t error) @@ -8619,7 +8621,9 @@ static RQ_END_IO_RET 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(6, 1, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #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()") */ diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index 1c168e2..e9a0390 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1462,8 +1462,12 @@ out: return ret; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) -/* See also commit fc7a6209d571 ("bus: Make remove callback return void") */ +/* + * See also commit fc7a6209d571 ("bus: Make remove callback return void") + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 2)) #define DRIVER_REMOVE_RET int #else #define DRIVER_REMOVE_RET void |