Skip to content

Commit

Permalink
scst: Unbreak the RHEL 9.5 build
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhananjay Kamble authored and lnocturno committed Nov 7, 2024
1 parent 2fea7e4 commit 70cf2f6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion scst/include/backport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
4 changes: 3 additions & 1 deletion scst/src/dev_handlers/scst_tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 6 additions & 2 deletions scst/src/scst_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down

0 comments on commit 70cf2f6

Please sign in to comment.