Implement the ktime_compare() and ktime_after() functions in the LinuxKPI.
Submitted by: Johannes Lundberg <johalun0@gmail.com> MFC after: 1 week Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks
This commit is contained in:
parent
a16387c1d4
commit
9e067b2256
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=334711
@ -127,6 +127,25 @@ ktime_add(ktime_t lhs, ktime_t rhs)
|
||||
return (lhs + rhs);
|
||||
}
|
||||
|
||||
static inline int
|
||||
ktime_compare(const ktime_t cmp1, const ktime_t cmp2)
|
||||
{
|
||||
|
||||
if (cmp1 > cmp2)
|
||||
return (1);
|
||||
else if (cmp1 < cmp2)
|
||||
return (-1);
|
||||
else
|
||||
return (0);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
ktime_after(const ktime_t cmp1, const ktime_t cmp2)
|
||||
{
|
||||
|
||||
return (ktime_compare(cmp1, cmp2) > 0);
|
||||
}
|
||||
|
||||
static inline ktime_t
|
||||
timespec_to_ktime(struct timespec ts)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user