summaryrefslogtreecommitdiffstats
path: root/include/linux/time_compat.h
diff options
context:
space:
mode:
authorbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-08-11 17:20:11 +0000
committerbehlendo <behlendo@7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c>2008-08-11 17:20:11 +0000
commit6a6cafbe8dd1e33530e726ee7d1c3acc340c6c15 (patch)
tree4d21cd48abb1becadf99452fe9c6618f847ddd1f /include/linux/time_compat.h
parent86149aa255dcfb145bb4f2ad66b80dce4d620f34 (diff)
Pull in timespec, list, and type compat changes to support
building against a wider range of kernels. git-svn-id: https://outreach.scidac.gov/svn/spl/trunk@152 7e1ea52c-4ff2-0310-8f11-9dd32ca42a1c
Diffstat (limited to 'include/linux/time_compat.h')
-rw-r--r--include/linux/time_compat.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/time_compat.h b/include/linux/time_compat.h
new file mode 100644
index 000000000..1b4727dcd
--- /dev/null
+++ b/include/linux/time_compat.h
@@ -0,0 +1,21 @@
+#ifndef _SPL_TIME_COMPAT_H
+#define _SPL_TIME_COMPAT_H
+
+#include <linux/time.h>
+
+/* timespec_sub() API changes
+ * 2.6.18 - 2.6.x: Inline function provided by linux/time.h
+ */
+#ifndef HAVE_TIMESPEC_SUB
+static inline struct timespec
+timespec_sub(struct timespec lhs, struct timespec rhs)
+{
+ struct timespec ts_delta;
+ set_normalized_timespec(&ts_delta, lhs.tv_sec - rhs.tv_sec,
+ lhs.tv_nsec - rhs.tv_nsec);
+ return ts_delta;
+}
+#endif /* HAVE_TIMESPEC_SUB */
+
+#endif /* _SPL_TIME_COMPAT_H */
+