summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-02-01 18:16:42 -0900
committerKent Overstreet <kent.overstreet@gmail.com>2017-02-06 20:45:37 -0900
commit5933f9478cc21e8b319309d2794948050d09b031 (patch)
tree781509d106b4aa5c99dda7e88028b58baf6de786 /include
parentab88049a08bf734b9a6c9f2deae39fbd0c933192 (diff)
update bcache code, fsck improvements
Diffstat (limited to 'include')
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/sched.h10
-rw-r--r--include/linux/time64.h5
3 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index e4ffa866..2233350b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -8,6 +8,7 @@
#include <limits.h>
#include <linux/bug.h>
+#include <linux/byteorder.h>
#include <linux/compiler.h>
#define IS_ENABLED(opt) 0
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 0316f50e..885cc56c 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -141,4 +141,14 @@ static inline u64 ktime_get_seconds(void)
return ts.tv_sec;
}
+static inline struct timespec current_kernel_time(void)
+{
+ struct timespec ts;
+
+ clock_gettime(CLOCK_MONOTONIC, &ts);
+ return ts;
+}
+
+#define CURRENT_TIME (current_kernel_time())
+
#endif /* __TOOLS_LINUX_SCHED_H */
diff --git a/include/linux/time64.h b/include/linux/time64.h
index 9d8a3efe..2e1ad82e 100644
--- a/include/linux/time64.h
+++ b/include/linux/time64.h
@@ -61,6 +61,11 @@ static inline struct timespec64 timespec_to_timespec64(const struct timespec ts)
# define ns_to_timespec64 ns_to_timespec
# define timespec64_add_ns timespec_add_ns
+static inline s64 timespec_to_ns(const struct timespec *ts)
+{
+ return ((s64) ts->tv_sec * NSEC_PER_SEC) + ts->tv_nsec;
+}
+
#else
static inline struct timespec timespec64_to_timespec(const struct timespec64 ts64)