From 5a85f399c887f20cb0c03f693075571629d8fb31 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 13 Apr 2019 22:55:58 +0000 Subject: [PATCH 1/3] scst/include/backport.h: Backport wwn_to_u64() git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8192 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index e05627e85..c5e59c07b 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1615,6 +1615,10 @@ enum { }; #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) +#define wwn_to_u64(wwn) get_unaligned_be64(wwn) +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) From e4a05976e768dd542d3cf5e96b8672bd4a5ea512 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 13 Apr 2019 22:56:39 +0000 Subject: [PATCH 2/3] scst/include/backport.h: Add wait_event_lock_irq_timeout() backport git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8193 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index c5e59c07b..f9d9baa8f 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1543,6 +1543,30 @@ static inline void *vzalloc(unsigned long size) } #endif +/* */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) +/* + * See also commit 25ab0bc334b4 ("scsi: sched/wait: Add + * wait_event_lock_irq_timeout for TASK_UNINTERRUPTIBLE usage") # v4.20. + */ +#define __wait_event_lock_irq_timeout(wq_head, condition, lock, timeout, state)\ + ___wait_event(wq_head, ___wait_cond_timeout(condition), \ + state, 0, timeout, \ + spin_unlock_irq(&lock); \ + __ret = schedule_timeout(__ret); \ + spin_lock_irq(&lock)); + +#define wait_event_lock_irq_timeout(wq_head, condition, lock, timeout) \ +({ \ + long __ret = timeout; \ + if (!___wait_cond_timeout(condition)) \ + __ret = __wait_event_lock_irq_timeout( \ + wq_head, condition, lock, timeout,\ + TASK_UNINTERRUPTIBLE); \ + __ret; \ +}) +#endif + /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 36) From a2ed73c2877ab9d8a64ff46dfcd65ae773b1f1ec Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 13 Apr 2019 22:57:18 +0000 Subject: [PATCH 3/3] scst/include/backport.h: Backport FC_PORTSPEED_64GBIT git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8194 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scst/include/backport.h b/scst/include/backport.h index f9d9baa8f..5e79f7b0b 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -1639,6 +1639,16 @@ enum { }; #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0) +/* + * See also commit cc019a5a3b58 ("scsi: scsi_transport_fc: fix typos on 64/128 + * GBit define names") # v4.16. + */ +enum { + FC_PORTSPEED_64GBIT = 0x1000 +}; +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0) #define wwn_to_u64(wwn) get_unaligned_be64(wwn) #endif