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 <david.chen@osnexus.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #6114
This commit is contained in:
Brian Behlendorf
2017-05-10 09:30:48 -07:00
committed by GitHub
parent a3eeab2de6
commit 2946a1a15a
7 changed files with 45 additions and 11 deletions
+11
View File
@@ -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 */