]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
LINUX: Update to Linux struct iattr->ia_ctime to timespec64 with 4.18
authorJoe Gorse <jhgorse@gmail.com>
Mon, 2 Jul 2018 20:36:04 +0000 (20:36 +0000)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 3 Aug 2018 13:34:15 +0000 (09:34 -0400)
With 4.18+ Linux kernels we see a transition to 64-bit time stamps by
default.

current_kernel_time() returns the 32-bit struct timespec.
current_kernel_time64() returns the 64-bit struct timespec64.

struct iattr->ia_ctime expects struct timespec64 as of 4.18+.

Timestamps greater than 31-bit rollover after 2147483647 or
January 19, 2038 03:14:07 UTC. This is the same approach taken by
the Linux developers for converting between timepsec64 and timespec.

Reviewed-on: https://gerrit.openafs.org/13241
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit 0bc5c15029cf7e720731f1415fcf9dc972d57ef4)

Change-Id: I16f93fd54dd45fe64f0c6fd499bf3adca978e9b1
Reviewed-on: https://gerrit.openafs.org/13268
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/LINUX/osi_file.c
src/cf/linux-kernel-assorted.m4
src/cf/linux-test4.m4

index 7069297a40cba9682361e24768f36b7d5990df19..fd68b16b382e52b3eaa0881d99bd5365a4dbdbdf 100644 (file)
 #include "osi_compat.h"
 
 #ifndef CURRENT_TIME
-#define CURRENT_TIME           (current_kernel_time())
+# ifdef IATTR_TAKES_64BIT_TIME
+#  define CURRENT_TIME         (current_kernel_time64())
+# else
+#  define CURRENT_TIME            (current_kernel_time())
+# endif
 #endif
 
 int cache_fh_type = -1;
index 384cbca2bfdee429639100c86b00263c515a0752..b991c3a617cb3dfdf95aa3752e6a965789cb2c23 100644 (file)
@@ -9,6 +9,7 @@ LINUX_KMEM_CACHE_CREATE_CTOR_TAKES_VOID
 LINUX_D_PATH_TAKES_STRUCT_PATH
 LINUX_NEW_EXPORT_OPS
 LINUX_INODE_SETATTR_RETURN_TYPE
+LINUX_IATTR_64BIT_TIME
 LINUX_IOP_I_CREATE_TAKES_NAMEIDATA
 LINUX_IOP_I_LOOKUP_TAKES_NAMEIDATA
 LINUX_IOP_I_PERMISSION_TAKES_FLAGS
index cdac30fbaad9bdae9610d98febd979f26a84696d..50b8a0ede4ff852f782c8e1ee60e6f3726633662 100644 (file)
@@ -183,7 +183,17 @@ AC_DEFUN([LINUX_INODE_SETATTR_RETURN_TYPE], [
                       [])
 ])
 
-
+AC_DEFUN([LINUX_IATTR_64BIT_TIME], [
+  AC_CHECK_LINUX_BUILD([whether struct iattr->ia_ctime takes struct timespec64 or 32-bit struct timespec],
+                       [ac_cv_linux_func_iattr_ctime_takes_timespec64],
+                       [#include <linux/fs.h>
+                        #include <linux/timekeeping.h>],
+                       [struct iattr _attrs;
+                        _attrs.ia_ctime = current_kernel_time64();],
+                       [IATTR_TAKES_64BIT_TIME],
+                       [define if struct iattr->ia_ctime takes struct timespec64],
+                       [])
+])
 
 AC_DEFUN([LINUX_AOP_WRITEBACK_CONTROL], [
   AC_CHECK_LINUX_BUILD([whether aop.writepage takes a writeback_control],