]> git.proxmox.com Git - mirror_spl.git/blob - include/linux/time_compat.h
Pull in timespec, list, and type compat changes to support
[mirror_spl.git] / include / linux / time_compat.h
1 #ifndef _SPL_TIME_COMPAT_H
2 #define _SPL_TIME_COMPAT_H
3
4 #include <linux/time.h>
5
6 /* timespec_sub() API changes
7 * 2.6.18 - 2.6.x: Inline function provided by linux/time.h
8 */
9 #ifndef HAVE_TIMESPEC_SUB
10 static inline struct timespec
11 timespec_sub(struct timespec lhs, struct timespec rhs)
12 {
13 struct timespec ts_delta;
14 set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
15 lhs.tv_nsec - rhs.tv_nsec);
16 return ts_delta;
17 }
18 #endif /* HAVE_TIMESPEC_SUB */
19
20 #endif /* _SPL_TIME_COMPAT_H */
21