aboutsummaryrefslogtreecommitdiff
path: root/fsck
diff options
context:
space:
mode:
authorDavid Anderson <dvander@google.com>2022-03-11 04:17:23 +0000
committerGao Xiang <hsiangkao@linux.alibaba.com>2022-03-19 02:31:39 +0800
commit34029db7f99a940712f47f72d44f0af7958ac15e (patch)
treed3c5d3bc97a111f4a884e43af782474b9b959e8c /fsck
parent1ab11aae4b78a4b0f75fa65047d2c419d4307dbb (diff)
downloaderofs-utils-34029db7f99a940712f47f72d44f0af7958ac15e.tar.gz
erofs-utils: mkfs: rename ctime to mtime
Currently mkfs.erofs picks up whatever the system time happened to be when the input file structure was created. Since there's no (easy) way for userspace to control ctime, there's no way to control the per-file ctime that mkfs.erofs uses. In preparation for switching to mtime, rename the "ctime" members of the inode structure. Link: https://lore.kernel.org/r/20220311041724.3107622-1-dvander@google.com Signed-off-by: David Anderson <dvander@google.com> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fsck')
-rw-r--r--fsck/main.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/fsck/main.c b/fsck/main.c
index 56595e3..7fc7b6f 100644
--- a/fsck/main.c
+++ b/fsck/main.c
@@ -229,14 +229,14 @@ static void erofsfsck_set_attributes(struct erofs_inode *inode, char *path)
#ifdef HAVE_UTIMENSAT
if (utimensat(AT_FDCWD, path, (struct timespec []) {
- [0] = { .tv_sec = inode->i_ctime,
- .tv_nsec = inode->i_ctime_nsec },
- [1] = { .tv_sec = inode->i_ctime,
- .tv_nsec = inode->i_ctime_nsec },
+ [0] = { .tv_sec = inode->i_mtime,
+ .tv_nsec = inode->i_mtime_nsec },
+ [1] = { .tv_sec = inode->i_mtime,
+ .tv_nsec = inode->i_mtime_nsec },
}, AT_SYMLINK_NOFOLLOW) < 0)
#else
- if (utime(path, &((struct utimbuf){.actime = inode->i_ctime,
- .modtime = inode->i_ctime})) < 0)
+ if (utime(path, &((struct utimbuf){.actime = inode->i_mtime,
+ .modtime = inode->i_mtime})) < 0)
#endif
erofs_warn("failed to set times: %s", path);