scst/include/backport.h: Fix the RHEL 9.0 build

Commit 9be09fd68b ("scst/include/backport.h: Fix building on
RHEL 8.8") fixed the build for RHEL 8.8, but at the same time, it
broke the build for RHEL 9.0.
This commit is contained in:
Gleb Chesnokov
2023-04-04 22:58:40 +03:00
parent 4fdb5273b6
commit 6f9a595f24

View File

@@ -1471,10 +1471,8 @@ static inline void scsi_build_sense(struct scsi_cmnd *scmd, int desc,
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
#if (!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7) || \
RHEL_RELEASE_CODE -0 == RHEL_RELEASE_VERSION(9, 0))
/*
* See also 51f3a4788928 ("scsi: core: Introduce the scsi_cmd_to_rq()
* function").
@@ -1485,6 +1483,32 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd)
}
#endif
/*
* See also commits 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag()
* helper") and ddd0bc756983 ("block: move ref_tag calculation func to the
* block layer"; v4.19).
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \
(defined(RHEL_RELEASE_CODE) && \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7))
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
{
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7
WARN_ON_ONCE(true);
return 0;
#else
struct request *rq = blk_mq_rq_from_pdu(scmd);
return t10_pi_ref_tag(rq);
#endif
}
#endif
#endif
/*
* See also commit c611529e7cd3 ("sd: Honor block layer integrity handling
* flags"; v3.18).
@@ -1498,28 +1522,6 @@ static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd)
}
#endif
/*
* See also commits 7ba46799d346 ("scsi: core: Add scsi_prot_ref_tag()
* helper") and ddd0bc756983 ("block: move ref_tag calculation func to the
* block layer"; v4.19).
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || \
(defined(RHEL_RELEASE_CODE) && \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 7)))
static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd)
{
#if defined(RHEL_MAJOR) && RHEL_MAJOR -0 == 7
WARN_ON_ONCE(true);
return 0;
#else
struct request *rq = blk_mq_rq_from_pdu(scmd);
return t10_pi_ref_tag(rq);
#endif
}
#endif
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1))