summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2017-05-10 09:30:48 -0700
committerGitHub <[email protected]>2017-05-10 09:30:48 -0700
commit2946a1a15aab874107b4425513c1bf805e730803 (patch)
tree21b3f8b56ed293b626eefc6549aeb74342ae3eb5 /include
parenta3eeab2de68670a4481eab3d086982aff23b6906 (diff)
Linux 4.12 compat: CURRENT_TIME removed
Linux 4.9 added current_time() as the preferred interface to get the filesystem time. CURRENT_TIME was retired in Linux 4.12. Reviewed-by: Chunwei Chen <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #6114
Diffstat (limited to 'include')
-rw-r--r--include/linux/vfs_compat.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h
index 4e61b1d09..0085aa850 100644
--- a/include/linux/vfs_compat.h
+++ b/include/linux/vfs_compat.h
@@ -565,5 +565,16 @@ func(const struct path *path, struct kstat *stat, u32 request_mask, \
#error
#endif
+/*
+ * 4.9 API change
+ * Preferred interface to get the current FS time.
+ */
+#if !defined(HAVE_CURRENT_TIME)
+static inline struct timespec
+current_time(struct inode *ip)
+{
+ return (timespec_trunc(current_kernel_time(), ip->i_sb->s_time_gran));
+}
+#endif
#endif /* _ZFS_VFS_H */