]> git.proxmox.com Git - mirror_spl.git/commitdiff
Linux 4.20 compat: current_kernel_time()
authorTony Hutter <hutter2@llnl.gov>
Thu, 25 Oct 2018 05:42:14 +0000 (22:42 -0700)
committerTony Hutter <hutter2@llnl.gov>
Thu, 8 Nov 2018 22:38:14 +0000 (14:38 -0800)
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.

Backported to SPL from zfs:82c0a050f

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/sys/time.h

index 90296719de7adf4eee5a29847e279da4074281da..563c210839769f190f5c155a00104a9dce9252ae 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);
 }