mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
scst/include/backport.h: Fix RHEL/CentOS 7 build
RHEL 7 and CentOS 7 provide a definition of ktime_before(). Hence hide the ktime_before() definition on these Linux distro's. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6986 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+18
-15
@@ -348,6 +348,24 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref)
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/ktime.h> */
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) && \
|
||||
LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) && \
|
||||
(!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7)
|
||||
/**
|
||||
* ktime_before - Compare if a ktime_t value is smaller than another one.
|
||||
* @cmp1: comparable1
|
||||
* @cmp2: comparable2
|
||||
*
|
||||
* Return: true if cmp1 happened before cmp2.
|
||||
*/
|
||||
static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
|
||||
{
|
||||
return ktime_compare(cmp1, cmp2) < 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* <linux/list.h> */
|
||||
|
||||
#ifndef __list_for_each
|
||||
@@ -678,19 +696,4 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && \
|
||||
(LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0))
|
||||
/**
|
||||
* ktime_before - Compare if a ktime_t value is smaller than another one.
|
||||
* @cmp1: comparable1
|
||||
* @cmp2: comparable2
|
||||
*
|
||||
* Return: true if cmp1 happened before cmp2.
|
||||
*/
|
||||
static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2)
|
||||
{
|
||||
return ktime_compare(cmp1, cmp2) < 0;
|
||||
}
|
||||
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) */
|
||||
|
||||
#endif /* _SCST_BACKPORT_H_ */
|
||||
|
||||
Reference in New Issue
Block a user