aboutsummaryrefslogtreecommitdiffstats
path: root/fs/adfs/inode.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2018-08-22 01:01:09 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-22 13:52:51 -0400
commitd9edcbc42c77b719e03dedb2aff719ae19659a0f (patch)
tree085aaeb5be2beba659081f98cafa7caaab526e07 /fs/adfs/inode.c
parent5f733e8a2dd130eaeed24cbaef49d349206cdb8b (diff)
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.de Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/adfs/inode.c')
-rw-r--r--fs/adfs/inode.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c
index e91028d4340a..66621e96f9af 100644
--- a/fs/adfs/inode.c
+++ b/fs/adfs/inode.c
@@ -167,7 +167,7 @@ adfs_mode2atts(struct super_block *sb, struct inode *inode)
167 * of time to convert from RISC OS epoch to Unix epoch. 167 * of time to convert from RISC OS epoch to Unix epoch.
168 */ 168 */
169static void 169static void
170adfs_adfs2unix_time(struct timespec *tv, struct inode *inode) 170adfs_adfs2unix_time(struct timespec64 *tv, struct inode *inode)
171{ 171{
172 unsigned int high, low; 172 unsigned int high, low;
173 /* 01 Jan 1970 00:00:00 (Unix epoch) as nanoseconds since 173 /* 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 /* convert from RISC OS to Unix epoch */ 195 /* convert from RISC OS to Unix epoch */
196 nsec -= nsec_unix_epoch_diff_risc_os_epoch; 196 nsec -= nsec_unix_epoch_diff_risc_os_epoch;
197 197
198 *tv = ns_to_timespec(nsec); 198 *tv = ns_to_timespec64(nsec);
199 return; 199 return;
200 200
201 cur_time: 201 cur_time:
202 *tv = timespec64_to_timespec(current_time(inode)); 202 *tv = current_time(inode);
203 return; 203 return;
204 204
205 too_early: 205 too_early:
@@ -242,7 +242,6 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs)
242struct inode * 242struct inode *
243adfs_iget(struct super_block *sb, struct object_info *obj) 243adfs_iget(struct super_block *sb, struct object_info *obj)
244{ 244{
245 struct timespec ts;
246 struct inode *inode; 245 struct inode *inode;
247 246
248 inode = new_inode(sb); 247 inode = new_inode(sb);
@@ -271,9 +270,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
271 ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000); 270 ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000);
272 271
273 inode->i_mode = adfs_atts2mode(sb, inode); 272 inode->i_mode = adfs_atts2mode(sb, inode);
274 ts = timespec64_to_timespec(inode->i_mtime); 273 adfs_adfs2unix_time(&inode->i_mtime, inode);
275 adfs_adfs2unix_time(&ts, inode);
276 inode->i_mtime = timespec_to_timespec64(ts);
277 inode->i_atime = inode->i_mtime; 274 inode->i_atime = inode->i_mtime;
278 inode->i_ctime = inode->i_mtime; 275 inode->i_ctime = inode->i_mtime;
279 276