orangefs: avoid time conversion function

The new orangefs code uses a helper function to read a time field to
its private structures from struct iattr. This will conflict with the
move to 64-bit timestamps in the kernel and is generally not necessary.

This replaces the conversion with a simple cast to time64_t that shows
what is going on. As the orangefs-internal representation already uses
64-bit timestamps, there should be no ambiguity to negative values,
and the cast ensures that we treat them as times before 1970 on both
32-bit and 64-bit architectures, rather than times after 2038. This
patch keeps that behavior.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c
index 488f350..8ef9e96 100644
--- a/fs/orangefs/orangefs-utils.c
+++ b/fs/orangefs/orangefs-utils.c
@@ -202,9 +202,9 @@
 
 	inode->i_uid = make_kuid(&init_user_ns, attrs->owner);
 	inode->i_gid = make_kgid(&init_user_ns, attrs->group);
-	inode->i_atime.tv_sec = (time_t) attrs->atime;
-	inode->i_mtime.tv_sec = (time_t) attrs->mtime;
-	inode->i_ctime.tv_sec = (time_t) attrs->ctime;
+	inode->i_atime.tv_sec = (time64_t) attrs->atime;
+	inode->i_mtime.tv_sec = (time64_t) attrs->mtime;
+	inode->i_ctime.tv_sec = (time64_t) attrs->ctime;
 	inode->i_atime.tv_nsec = 0;
 	inode->i_mtime.tv_nsec = 0;
 	inode->i_ctime.tv_nsec = 0;
@@ -301,16 +301,14 @@
 	if (iattr->ia_valid & ATTR_ATIME) {
 		attrs->mask |= ORANGEFS_ATTR_SYS_ATIME;
 		if (iattr->ia_valid & ATTR_ATIME_SET) {
-			attrs->atime =
-			    orangefs_convert_time_field(&iattr->ia_atime);
+			attrs->atime = (time64_t)iattr->ia_atime.tv_sec;
 			attrs->mask |= ORANGEFS_ATTR_SYS_ATIME_SET;
 		}
 	}
 	if (iattr->ia_valid & ATTR_MTIME) {
 		attrs->mask |= ORANGEFS_ATTR_SYS_MTIME;
 		if (iattr->ia_valid & ATTR_MTIME_SET) {
-			attrs->mtime =
-			    orangefs_convert_time_field(&iattr->ia_mtime);
+			attrs->mtime = (time64_t)iattr->ia_mtime.tv_sec;
 			attrs->mask |= ORANGEFS_ATTR_SYS_MTIME_SET;
 		}
 	}