]> git.proxmox.com Git - mirror_spl.git/commitdiff
Add a macro to convert seconds to nanoseconds and vice-versa
authorDavid Quigley <dpquigl@users.noreply.github.com>
Thu, 5 May 2016 23:10:46 +0000 (19:10 -0400)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Thu, 5 May 2016 23:10:46 +0000 (16:10 -0700)
Required infrastructure for zfsonlinux/zfs#4600.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #546

include/sys/time.h

index 650166145b1accc1699a6d333cd836ef68edf956..611f5dd2d8d1d0aadc635277fa0cc89f423f34c8 100644 (file)
@@ -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)           \