From 70cf2f6271fc7efccabc069dd5ae0a4763db13b2 Mon Sep 17 00:00:00 2001 From: Dhananjay Kamble Date: Tue, 5 Nov 2024 15:10:38 -0500 Subject: [PATCH] scst: Unbreak the RHEL 9.5 build --- scst/include/backport.h | 4 +++- scst/src/dev_handlers/scst_tape.c | 4 +++- scst/src/scst_lib.c | 8 ++++++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 6651a39a2..803fcf6e4 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -288,7 +288,9 @@ static inline void blkdev_put_backport(struct block_device *bdev, void *holder) #if LINUX_VERSION_CODE < KERNEL_VERSION(6, 7, 0) && \ (LINUX_VERSION_CODE >> 8 != KERNEL_VERSION(6, 6, 0) >> 8 || \ - LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 23)) + LINUX_VERSION_CODE < KERNEL_VERSION(6, 6, 23)) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 5)) /* * See also commit e719b4d15674 ("block: Provide bdev_open_* functions") # v6.7, v6.6.23. */ diff --git a/scst/src/dev_handlers/scst_tape.c b/scst/src/dev_handlers/scst_tape.c index f164390b8..c744ba2ab 100644 --- a/scst/src/dev_handlers/scst_tape.c +++ b/scst/src/dev_handlers/scst_tape.c @@ -173,7 +173,9 @@ static int tape_attach(struct scst_device *dev) ((dev->scsi_dev->scsi_level <= SCSI_2) ? ((dev->scsi_dev->lun << 5) & 0xe0) : 0), 0 /* Mode Page 0 */, -#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0) || \ + (defined(RHEL_RELEASE_CODE) && \ + RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(9, 5)) 0 /* Sub Page */, #endif buffer, buffer_size, diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 5dcb8b141..2e322d9a1 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -6083,7 +6083,9 @@ int scst_open_bdev_by_path(const char *path, blk_mode_t mode, void *holder, const struct blk_holder_ops *hops, struct scst_bdev_descriptor *bdev_desc) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 5)) struct bdev_handle *bdev_handle; bdev_handle = bdev_open_by_path(path, mode, holder, hops); @@ -6109,7 +6111,9 @@ EXPORT_SYMBOL(scst_open_bdev_by_path); void scst_release_bdev(struct scst_bdev_descriptor *bdev_desc) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0) +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 9, 0) && \ + (!defined(RHEL_RELEASE_CODE) || \ + RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 5)) struct bdev_handle *bdev_handle = bdev_desc->priv; if (bdev_handle)