From: Gleb C. <lna...@ya...> - 2023-05-10 10:42:50
|
Commit: b4e012c GitHub URL: https://github.com/SCST-project/scst/commit/b4e012ca423441782f4396d5299623a710258e5c Author: Gleb Chesnokov Date: 2023-05-10T13:39:06+03:00 Log Message: ----------- scst/include/backport.h: Fix the RHEL 9.0 build Commit 9be09fd68b46 ("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. Modified Paths: -------------- scst/include/backport.h | 42 ++++++++------- 1 file changed, 22 insertions(+), 20 deletions(-) =================================================================== diff --git a/scst/include/backport.h b/scst/include/backport.h index 2e154ce..c871706 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1464,10 +1464,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"). @@ -1478,27 +1476,18 @@ static inline struct request *scsi_cmd_to_rq(struct scsi_cmnd *scmd) } #endif -/* - * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling - * flags"; v3.18). - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) -static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) -{ - /* To do: backport this function properly. */ - WARN_ON_ONCE(true); - return 512; -} -#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))) +#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 @@ -1513,6 +1502,19 @@ static inline u32 scsi_prot_ref_tag(struct scsi_cmnd *scmd) #endif #endif +/* + * See also commit c611529e7cd3 ("sd: Honor block layer integrity handling + * flags"; v3.18). + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) +static inline unsigned int scsi_prot_interval(struct scsi_cmnd *scmd) +{ + /* To do: backport this function properly. */ + WARN_ON_ONCE(true); + return 512; +} +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 16, 0) && \ (!defined(RHEL_RELEASE_CODE) || \ RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(9, 1)) |