this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support Linux versions that don't yet have nsecs_to_jiffies()

+7 -1
+7 -1
src/lkm/primitives/semaphore.c
··· 24 24 #include <linux/semaphore.h> 25 25 #include <linux/slab.h> 26 26 #include <linux/atomic.h> 27 + #include <linux/version.h> 27 28 28 29 static atomic_t sem_count = ATOMIC_INIT(0); 29 30 ··· 173 174 174 175 ret = KERN_SUCCESS; 175 176 176 - jiffies = nsecs_to_jiffies(((u64) sec) * 1000000000ull + nsec); 177 + #if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0) 178 + jiffies = sec * HZ; 179 + jiffies += nsec / (NSEC_PER_SEC / HZ); 180 + #else 181 + jiffies = nsecs_to_jiffies(((u64) sec) * NSEC_PER_SEC + nsec); 182 + #endif 177 183 178 184 err = down_timeout(&ms->sem, jiffies); 179 185 if (err == -ETIME)