]> granicus.if.org Git - zfs/commitdiff
Linux 4.20 compat: current_kernel_time()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 31 Oct 2018 16:50:42 +0000 (11:50 -0500)
committerGitHub <noreply@github.com>
Wed, 31 Oct 2018 16:50:42 +0000 (11:50 -0500)
Commit torvalds/linux@976516404 removed the current_kernel_time()
function (and several others).  All callers are expected to use
current_kernel_time64().  Update the gethrestime_sec() wrapper
accordingly.

Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #8074

include/spl/sys/time.h

index 37f5e35df2afcfef199b608f1e2d7c8a60ddbd79..1a986c9b97cd75c71a31b58ae756be5a522a7d65 100644 (file)
@@ -82,8 +82,11 @@ gethrestime(inode_timespec_t *ts)
 static inline time_t
 gethrestime_sec(void)
 {
-       struct timespec ts;
-       ts = current_kernel_time();
+#if defined(HAVE_INODE_TIMESPEC64_TIMES)
+       inode_timespec_t ts = current_kernel_time64();
+#else
+       inode_timespec_t ts = current_kernel_time();
+#endif
        return (ts.tv_sec);
 }