Commit ea60635e authored by Jeff Layton's avatar Jeff Layton Committed by Christian Brauner

fat: convert to ctime accessor functions

In later patches, we're going to change how the inode's ctime field is
used. Switch to using accessor functions instead of raw accesses of
inode->i_ctime.
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Message-Id: <20230705190309.579783-42-jlayton@kernel.org>
Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent c62ebd35
...@@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de) ...@@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
& ~((loff_t)sbi->cluster_size - 1)) >> 9; & ~((loff_t)sbi->cluster_size - 1)) >> 9;
fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0);
inode->i_ctime = inode->i_mtime; inode_set_ctime_to_ts(inode, inode->i_mtime);
if (sbi->options.isvfat) { if (sbi->options.isvfat) {
fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0);
fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime, fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime,
...@@ -1407,8 +1407,7 @@ static int fat_read_root(struct inode *inode) ...@@ -1407,8 +1407,7 @@ static int fat_read_root(struct inode *inode)
MSDOS_I(inode)->mmu_private = inode->i_size; MSDOS_I(inode)->mmu_private = inode->i_size;
fat_save_attrs(inode, ATTR_DIR); fat_save_attrs(inode, ATTR_DIR);
inode->i_mtime.tv_sec = inode->i_atime.tv_sec = inode->i_ctime.tv_sec = 0; inode->i_mtime = inode->i_atime = inode_set_ctime(inode, 0, 0);
inode->i_mtime.tv_nsec = inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = 0;
set_nlink(inode, fat_subdirs(inode)+2); set_nlink(inode, fat_subdirs(inode)+2);
return 0; return 0;
......
...@@ -332,7 +332,8 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags) ...@@ -332,7 +332,8 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags)
* but ctime updates are ignored. * but ctime updates are ignored.
*/ */
if (flags & S_MTIME) if (flags & S_MTIME)
inode->i_mtime = inode->i_ctime = fat_truncate_mtime(sbi, now); inode->i_mtime = inode_set_ctime_to_ts(inode,
fat_truncate_mtime(sbi, now));
return 0; return 0;
} }
......
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