scst, scst_local: Port to RHEL / CentOS 8.3

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9221 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2020-12-20 04:26:40 +00:00
parent ab65209f50
commit 5f2e23c23b
2 changed files with 12 additions and 4 deletions

View File

@@ -964,7 +964,9 @@ static inline void lockdep_unregister_key(struct lock_class_key *key)
* See also commit 5facae4f3549 ("locking/lockdep: Remove unused @nested
* argument from lock_release()").
*/
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3))
#undef rwlock_release
#define rwlock_release(l, i) lock_release(l, 1, i)
#undef mutex_release
@@ -2006,7 +2008,9 @@ static inline struct ib_pd *ib_alloc_pd_backport(struct ib_device *device)
/* <scsi/scsi_cmnd.h> */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) || \
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || \
(defined(RHEL_RELEASE_CODE) && \
RHEL_RELEASE_CODE -0 >= RHEL_RELEASE_VERSION(8, 3))
/*
* See also patch "[SCSI] bidirectional command support" (commit ID
* 6f9a35e2dafa). See also commit ae3d56d81507 ("scsi: remove bidirectional

View File

@@ -1011,8 +1011,10 @@ static int scst_local_queuecommand_lck(struct scsi_cmnd *scmd,
#endif
if (scsi_bidi_cmnd(scmd)) {
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) && \
LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 24) && \
LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && \
(!defined(RHEL_RELEASE_CODE) || \
RHEL_RELEASE_CODE -0 < RHEL_RELEASE_VERSION(8, 3))
/* Some of these symbols are only defined after 2.6.24 */
dir = SCST_DATA_BIDI;
scst_cmd_set_expected(scst_cmd, dir, scsi_bufflen(scmd));
@@ -1155,6 +1157,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev)
{
struct request_queue *q = sdev->request_queue;
#ifdef QUEUE_FLAG_BIDI
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) && \
!defined(CONFIG_SUSE_KERNEL)
#if !defined(RHEL_MAJOR) || RHEL_MAJOR -0 >= 6
@@ -1162,6 +1165,7 @@ static int scst_local_slave_alloc(struct scsi_device *sdev)
#endif
#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
blk_queue_flag_set(QUEUE_FLAG_BIDI, q);
#endif
#endif
/*