Linux 5.6 compat: timestamp_truncate()

The timestamp_truncate() function was added, it replaces the existing
timespec64_trunc() function.  This change renames our wrapper function
to be consistent with the upstream name and updates the compatibility
code for older kernels accordingly.

Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #9956
Closes #9961
This commit is contained in:
Brian Behlendorf
2020-02-06 12:37:25 -08:00
parent 0dd7364853
commit 795699a6cc
4 changed files with 40 additions and 18 deletions
+7 -6
View File
@@ -170,13 +170,14 @@ zpl_dir_emit_dots(struct file *file, zpl_dir_context_t *ctx)
}
#endif /* HAVE_VFS_ITERATE */
/*
* Linux 4.18, inode times converted from timespec to timespec64.
*/
#if defined(HAVE_INODE_TIMESPEC64_TIMES)
#define zpl_inode_timespec_trunc(ts, gran) timespec64_trunc(ts, gran)
#if defined(HAVE_INODE_TIMESTAMP_TRUNCATE)
#define zpl_inode_timestamp_truncate(ts, ip) timestamp_truncate(ts, ip)
#elif defined(HAVE_INODE_TIMESPEC64_TIMES)
#define zpl_inode_timestamp_truncate(ts, ip) \
timespec64_trunc(ts, (ip)->i_sb->s_time_gran)
#else
#define zpl_inode_timespec_trunc(ts, gran) timespec_trunc(ts, gran)
#define zpl_inode_timestamp_truncate(ts, ip) \
timespec_trunc(ts, (ip)->i_sb->s_time_gran)
#endif
#endif /* _SYS_ZPL_H */