From 5e39e4f0b26551769e0cfc50987cbb8cdef5fbcf Mon Sep 17 00:00:00 2001
From: David Quigley <dpquigl@users.noreply.github.com>
Date: Thu, 5 May 2016 19:10:46 -0400
Subject: Add a macro to convert seconds to nanoseconds and vice-versa

Required infrastructure for zfsonlinux/zfs#4600.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #546
---
 include/sys/time.h | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'include')

diff --git a/include/sys/time.h b/include/sys/time.h
index 650166145..611f5dd2d 100644
--- a/include/sys/time.h
+++ b/include/sys/time.h
@@ -46,6 +46,9 @@
 #define	MSEC2NSEC(m)	((hrtime_t)(m) * (NANOSEC / MILLISEC))
 #define	NSEC2MSEC(n)	((n) / (NANOSEC / MILLISEC))
 
+#define NSEC2SEC(n)     ((n) / (NANOSEC / SEC))
+#define SEC2NSEC(m)     ((hrtime_t)(m) * (NANOSEC / SEC))  
+
 static const int hz = HZ;
 
 #define	TIMESPEC_OVERFLOW(ts)		\
-- 
cgit v1.2.3