]) # LC_I_PAGES
#
+# LC_INODE_TIMESPEC64
+#
+# kernel 4.18 commit 95582b00838837fc07e042979320caf917ce3fe6
+# inode timestamps switched to timespec64
+#
+AC_DEFUN([LC_INODE_TIMESPEC64], [
+LB_CHECK_COMPILE([if inode timestamps are struct timespec64],
+inode_timespec64, [
+ #include <linux/fs.h>
+],[
+ struct inode inode = {};
+ struct timespec64 ts = {};
+
+ inode.i_atime = ts;
+],[
+ AC_DEFINE(HAVE_INODE_TIMESPEC64, 1,
+ [inode times are using timespec64])
+])
+]) # LC_INODE_TIMESPEC64
+
+#
# LC_PROG_LINUX
#
# Lustre linux kernel checks
# 4.17
LC_I_PAGES
+ # 4.18
+ LC_INODE_TIMESPEC64
+
# kernel patch to extend integrity interface
LC_BIO_INTEGRITY_PREP_FN
return obj->oo_owner == env;
}
-static struct timespec *osd_inode_time(const struct lu_env *env,
+#ifdef HAVE_INODE_TIMESPEC64
+static struct timespec64 osd_inode_time(const struct lu_env *env,
struct inode *inode, __u64 seconds)
+#else
+static struct timespec osd_inode_time(const struct lu_env *env,
+ struct inode *inode, __u64 seconds)
+#endif
{
struct osd_thread_info *oti = osd_oti_get(env);
struct timespec *t = &oti->oti_time;
t->tv_sec = seconds;
t->tv_nsec = 0;
*t = timespec_trunc(*t, inode->i_sb->s_time_gran);
- return t;
+#ifdef HAVE_INODE_TIMESPEC64
+ return timespec_to_timespec64(*t);
+#else
+ return *t;
+#endif
}
static void osd_inode_getattr(const struct lu_env *env,
return 0;
if (bits & LA_ATIME)
- inode->i_atime = *osd_inode_time(env, inode, attr->la_atime);
+ inode->i_atime = osd_inode_time(env, inode, attr->la_atime);
if (bits & LA_CTIME)
- inode->i_ctime = *osd_inode_time(env, inode, attr->la_ctime);
+ inode->i_ctime = osd_inode_time(env, inode, attr->la_ctime);
if (bits & LA_MTIME)
- inode->i_mtime = *osd_inode_time(env, inode, attr->la_mtime);
+ inode->i_mtime = osd_inode_time(env, inode, attr->la_mtime);
if (bits & LA_SIZE) {
spin_lock(&inode->i_lock);
LDISKFS_I(inode)->i_disksize = attr->la_size;