scst: Unbreak the RHEL 9.2 build

See also PR https://github.com/SCST-project/scst/pull/145.
This commit is contained in:
Gleb Chesnokov
2023-04-04 12:46:30 +03:00
parent b4e012ca42
commit 28e8d31f86
5 changed files with 34 additions and 12 deletions

View File

@@ -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.
*

View File

@@ -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);

View File

@@ -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);

View File

@@ -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()") */

View File

@@ -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