Skip to content

Commit

Permalink
Merge pull request data-accelerator#6 from liulanzheng/master
Browse files Browse the repository at this point in the history
no timestamp for mkfs
  • Loading branch information
yuchen0cc authored May 10, 2023
2 parents dfc6b00 + 5e618bd commit 5c1a477
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/ext2fs/initialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,11 @@ errcode_t ext2fs_initialize(const char *name, int flags,
}

set_field(s_checkinterval, 0);
#ifndef NO_TIMESTAMP
super->s_mkfs_time = super->s_lastcheck = fs->now ? fs->now : time(NULL);
#else
super->s_mkfs_time = super->s_lastcheck = 0;
#endif

super->s_creator_os = CREATOR_OS;

Expand Down
8 changes: 8 additions & 0 deletions lib/ext2fs/res_gdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,11 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
retval = ext2fs_inode_size_set(fs, &inode, inode_size);
if (retval)
goto out_free;
#ifndef NO_TIMESTAMP
inode.i_ctime = fs->now ? fs->now : time(0);
#else
inode.i_ctime = 0;
#endif
}

for (rsv_off = 0, gdt_off = fs->desc_blocks,
Expand Down Expand Up @@ -227,7 +231,11 @@ errcode_t ext2fs_create_resize_inode(ext2_filsys fs)
EXT2_I_SIZE(&inode));
#endif
if (inode_dirty) {
#ifndef NO_TIMESTAMP
inode.i_atime = inode.i_mtime = fs->now ? fs->now : time(0);
#else
inode.i_atime = inode.i_mtime = 0;
#endif
retval2 = ext2fs_write_new_inode(fs, EXT2_RESIZE_INO, &inode);
if (!retval)
retval = retval2;
Expand Down

0 comments on commit 5c1a477

Please sign in to comment.