From c4592b9c37889c2850b0edadcff063d5097f1cb9 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Fri, 13 Jul 2018 16:47:16 +0200 Subject: jffs2: use 64-bit intermediate timestamps The VFS now uses timespec64 timestamps consistently, but jffs2 still converts them to 32-bit numbers on the storage medium. As the helper functions for the conversion (get_seconds() and timespec_to_timespec64()) are now deprecated, let's change them over to the more modern replacements. This keeps the traditional interpretation of those values, where the on-disk 32-bit numbers are taken to be negative numbers, i.e. dates before 1970, on 32-bit machines, but future numbers past 2038 on 64-bit machines. Signed-off-by: Arnd Bergmann Signed-off-by: Boris Brezillon --- fs/jffs2/os-linux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'fs/jffs2/os-linux.h') diff --git a/fs/jffs2/os-linux.h b/fs/jffs2/os-linux.h index c2fbec19c616..acbe1f722f2d 100644 --- a/fs/jffs2/os-linux.h +++ b/fs/jffs2/os-linux.h @@ -31,7 +31,8 @@ struct kvec; #define JFFS2_F_I_GID(f) (i_gid_read(OFNI_EDONI_2SFFJ(f))) #define JFFS2_F_I_RDEV(f) (OFNI_EDONI_2SFFJ(f)->i_rdev) -#define ITIME(sec) ((struct timespec){sec, 0}) +#define ITIME(sec) ((struct timespec64){(int32_t)sec, 0}) +#define JFFS2_NOW() (ktime_get_real_seconds()) #define I_SEC(tv) ((tv).tv_sec) #define JFFS2_F_I_CTIME(f) (OFNI_EDONI_2SFFJ(f)->i_ctime.tv_sec) #define JFFS2_F_I_MTIME(f) (OFNI_EDONI_2SFFJ(f)->i_mtime.tv_sec) -- cgit v1.2.3