Commit d9edcbc4 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Linus Torvalds

adfs: use timespec64 for time conversion

We just truncate the seconds to 32-bit in one place now, so this can
trivially be converted over to using timespec64 consistently.

Link: http://lkml.kernel.org/r/20180620100133.4035614-1-arnd@arndb.deSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5f733e8a
...@@ -167,7 +167,7 @@ adfs_mode2atts(struct super_block *sb, struct inode *inode) ...@@ -167,7 +167,7 @@ adfs_mode2atts(struct super_block *sb, struct inode *inode)
* of time to convert from RISC OS epoch to Unix epoch. * of time to convert from RISC OS epoch to Unix epoch.
*/ */
static void static void
adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) adfs_adfs2unix_time(struct timespec64 *tv, struct inode *inode)
{ {
unsigned int high, low; unsigned int high, low;
/* 01 Jan 1970 00:00:00 (Unix epoch) as nanoseconds since /* 01 Jan 1970 00:00:00 (Unix epoch) as nanoseconds since
...@@ -195,11 +195,11 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) ...@@ -195,11 +195,11 @@ adfs_adfs2unix_time(struct timespec *tv, struct inode *inode)
/* convert from RISC OS to Unix epoch */ /* convert from RISC OS to Unix epoch */
nsec -= nsec_unix_epoch_diff_risc_os_epoch; nsec -= nsec_unix_epoch_diff_risc_os_epoch;
*tv = ns_to_timespec(nsec); *tv = ns_to_timespec64(nsec);
return; return;
cur_time: cur_time:
*tv = timespec64_to_timespec(current_time(inode)); *tv = current_time(inode);
return; return;
too_early: too_early:
...@@ -242,7 +242,6 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs) ...@@ -242,7 +242,6 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs)
struct inode * struct inode *
adfs_iget(struct super_block *sb, struct object_info *obj) adfs_iget(struct super_block *sb, struct object_info *obj)
{ {
struct timespec ts;
struct inode *inode; struct inode *inode;
inode = new_inode(sb); inode = new_inode(sb);
...@@ -271,9 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj) ...@@ -271,9 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000);
inode->i_mode = adfs_atts2mode(sb, inode); inode->i_mode = adfs_atts2mode(sb, inode);
ts = timespec64_to_timespec(inode->i_mtime); adfs_adfs2unix_time(&inode->i_mtime, inode);
adfs_adfs2unix_time(&ts, inode);
inode->i_mtime = timespec_to_timespec64(ts);
inode->i_atime = inode->i_mtime; inode->i_atime = inode->i_mtime;
inode->i_ctime = inode->i_mtime; inode->i_ctime = inode->i_mtime;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment