Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

adfs: convert to new timestamp accessors

Convert to using the new inode timestamp accessor functions.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20231004185347.80880-14-jlayton@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jeff Layton and committed by
Christian Brauner
ca9649e9 d0242a3a

+8 -5
+8 -5
fs/adfs/inode.c
··· 242 242 adfs_iget(struct super_block *sb, struct object_info *obj) 243 243 { 244 244 struct inode *inode; 245 + struct timespec64 ts; 245 246 246 247 inode = new_inode(sb); 247 248 if (!inode) ··· 269 268 ADFS_I(inode)->attr = obj->attr; 270 269 271 270 inode->i_mode = adfs_atts2mode(sb, inode); 272 - adfs_adfs2unix_time(&inode->i_mtime, inode); 273 - inode->i_atime = inode->i_mtime; 274 - inode_set_ctime_to_ts(inode, inode->i_mtime); 271 + adfs_adfs2unix_time(&ts, inode); 272 + inode_set_atime_to_ts(inode, ts); 273 + inode_set_mtime_to_ts(inode, ts); 274 + inode_set_ctime_to_ts(inode, ts); 275 275 276 276 if (S_ISDIR(inode->i_mode)) { 277 277 inode->i_op = &adfs_dir_inode_operations; ··· 323 321 324 322 if (ia_valid & ATTR_MTIME && adfs_inode_is_stamped(inode)) { 325 323 adfs_unix2adfs_time(inode, &attr->ia_mtime); 326 - adfs_adfs2unix_time(&inode->i_mtime, inode); 324 + adfs_adfs2unix_time(&attr->ia_mtime, inode); 325 + inode_set_mtime_to_ts(inode, attr->ia_mtime); 327 326 } 328 327 329 328 /* ··· 332 329 * have the ability to represent them in our filesystem? 333 330 */ 334 331 if (ia_valid & ATTR_ATIME) 335 - inode->i_atime = attr->ia_atime; 332 + inode_set_atime_to_ts(inode, attr->ia_atime); 336 333 if (ia_valid & ATTR_CTIME) 337 334 inode_set_ctime_to_ts(inode, attr->ia_ctime); 338 335 if (ia_valid & ATTR_MODE) {