]> git.proxmox.com Git - zfsonlinux.git/blob - spl-patches/0005-Linux-4.20-compat-current_kernel_time.patch
update/rebase to spl-0.7.12 with patches from ZOL
[zfsonlinux.git] / spl-patches / 0005-Linux-4.20-compat-current_kernel_time.patch
1 From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2 From: Tony Hutter <hutter2@llnl.gov>
3 Date: Wed, 24 Oct 2018 22:42:14 -0700
4 Subject: [PATCH] Linux 4.20 compat: current_kernel_time()
5
6 Commit torvalds/linux@976516404 removed the current_kernel_time()
7 function (and several others). All callers are expected to use
8 current_kernel_time64(). Update the gethrestime_sec() wrapper
9 accordingly.
10
11 Backported to SPL from zfs:82c0a050f
12
13 Reviewed-by: Olaf Faaland <faaland1@llnl.gov>
14 Reviewed-by: Tony Hutter <hutter2@llnl.gov>
15 Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
16 Closes #8074
17
18 Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
19 ---
20 include/sys/time.h | 7 +++++--
21 1 file changed, 5 insertions(+), 2 deletions(-)
22
23 diff --git a/include/sys/time.h b/include/sys/time.h
24 index 9029671..563c210 100644
25 --- a/include/sys/time.h
26 +++ b/include/sys/time.h
27 @@ -82,8 +82,11 @@ gethrestime(inode_timespec_t *ts)
28 static inline time_t
29 gethrestime_sec(void)
30 {
31 - struct timespec ts;
32 - ts = current_kernel_time();
33 +#if defined(HAVE_INODE_TIMESPEC64_TIMES)
34 + inode_timespec_t ts = current_kernel_time64();
35 +#else
36 + inode_timespec_t ts = current_kernel_time();
37 +#endif
38 return (ts.tv_sec);
39 }
40