]> granicus.if.org Git - spl/commitdiff
Allow 64-bit timestamps to be set on 64-bit kernels
authorChris Dunlop <chris@onthe.net.au>
Tue, 6 Dec 2011 04:29:58 +0000 (15:29 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 12 Dec 2011 19:06:03 +0000 (11:06 -0800)
ZFS and 64-bit linux are perfectly capable of dealing with 64-bit
timestamps, but ZFS deliberately prevents setting them.  Adjust
the SPL such that TIMESPEC_OVERFLOW will not always assume 32-bit
values and instead use the correct values for your kernel build.
This effectively allows 64-bit timestamps on 64-bit systems.

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

include/sys/time.h

index ed3aae934c7561a884c40b69ffe1635f12e368d3..341b531ef0e8fa35ac094c600eeb2879f1eac1f5 100644 (file)
 #include <sys/types.h>
 #include <sys/timer.h>
 
-#define TIME32_MAX                     INT32_MAX
-#define TIME32_MIN                     INT32_MIN
+#if defined(CONFIG_64BIT)
+#define TIME_MAX                       INT64_MAX
+#define TIME_MIN                       INT64_MIN
+#else
+#define TIME_MAX                       INT32_MAX
+#define TIME_MIN                       INT32_MIN
+#endif
 
 #define SEC                            1
 #define MILLISEC                       1000
@@ -83,6 +88,6 @@ gethrestime_sec(void)
 }
 
 #define TIMESPEC_OVERFLOW(ts)          \
-       ((ts)->tv_sec < TIME32_MIN || (ts)->tv_sec > TIME32_MAX)
+       ((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)
 
 #endif  /* _SPL_TIME_H */