summaryrefslogtreecommitdiffstats
path: root/fs/fat
diff options
context:
space:
mode:
authorJeff Layton <jlayton@kernel.org>2023-07-05 15:01:09 -0400
committerChristian Brauner <brauner@kernel.org>2023-07-24 10:29:59 +0200
commitea60635ec1f456b4cf8ecf1ead2e203c9226e0d6 (patch)
treefbad7ab7eeaad7a22e53530c4d12340017abd9a4 /fs/fat
parentc62ebd3501cc2c78d4cc28a9b4cbdb17d199c6d6 (diff)
downloadlinux-stable-ea60635ec1f456b4cf8ecf1ead2e203c9226e0d6.tar.gz
linux-stable-ea60635ec1f456b4cf8ecf1ead2e203c9226e0d6.tar.bz2
linux-stable-ea60635ec1f456b4cf8ecf1ead2e203c9226e0d6.zip
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: Jeff Layton <jlayton@kernel.org> Message-Id: <20230705190309.579783-42-jlayton@kernel.org> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/fat')
-rw-r--r--fs/fat/inode.c5
-rw-r--r--fs/fat/misc.c3
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c
index d99b8549ec8f..cdd39b6020f3 100644
--- a/fs/fat/inode.c
+++ b/fs/fat/inode.c
@@ -562,7 +562,7 @@ int fat_fill_inode(struct inode *inode, struct msdos_dir_entry *de)
& ~((loff_t)sbi->cluster_size - 1)) >> 9;
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) {
fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0);
fat_time_fat2unix(sbi, &MSDOS_I(inode)->i_crtime, de->ctime,
@@ -1407,8 +1407,7 @@ static int fat_read_root(struct inode *inode)
MSDOS_I(inode)->mmu_private = inode->i_size;
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.tv_nsec = inode->i_atime.tv_nsec = inode->i_ctime.tv_nsec = 0;
+ inode->i_mtime = inode->i_atime = inode_set_ctime(inode, 0, 0);
set_nlink(inode, fat_subdirs(inode)+2);
return 0;
diff --git a/fs/fat/misc.c b/fs/fat/misc.c
index 7e5d6ae305f2..67006ea08db6 100644
--- a/fs/fat/misc.c
+++ b/fs/fat/misc.c
@@ -332,7 +332,8 @@ int fat_truncate_time(struct inode *inode, struct timespec64 *now, int flags)
* but ctime updates are ignored.
*/
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;
}