summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem/Ext2FileSystem.cpp
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2021-02-28 02:18:48 +0100
committerAndreas Kling <kling@serenityos.org>2021-03-02 08:36:08 +0100
commit336303bda47177aba0ee0ca4d81148ab15a916eb (patch)
tree7a023b37b117ada2dd524d68f7316a12b2ba65ce /Kernel/FileSystem/Ext2FileSystem.cpp
parent05d5e3fad90c5e45b7d65b74251e2c7b8907936e (diff)
downloadserenity-336303bda47177aba0ee0ca4d81148ab15a916eb.zip
Kernel: Make kgettimeofday use AK::Time
Diffstat (limited to 'Kernel/FileSystem/Ext2FileSystem.cpp')
-rw-r--r--Kernel/FileSystem/Ext2FileSystem.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Kernel/FileSystem/Ext2FileSystem.cpp b/Kernel/FileSystem/Ext2FileSystem.cpp
index 284ef795d8..d6befa6882 100644
--- a/Kernel/FileSystem/Ext2FileSystem.cpp
+++ b/Kernel/FileSystem/Ext2FileSystem.cpp
@@ -572,7 +572,7 @@ void Ext2FS::free_inode(Ext2FSInode& inode)
// NOTE: After this point, the inode metadata is wiped.
memset(&inode.m_raw_inode, 0, sizeof(ext2_inode));
- inode.m_raw_inode.i_dtime = kgettimeofday().tv_sec;
+ inode.m_raw_inode.i_dtime = kgettimeofday().to_truncated_seconds();
write_ext2_inode(inode.index(), inode.m_raw_inode);
// Mark the inode as free.
@@ -1429,14 +1429,14 @@ KResultOr<NonnullRefPtr<Inode>> Ext2FS::create_inode(Ext2FSInode& parent_inode,
return ENOENT;
ext2_inode e2inode {};
- auto now = kgettimeofday();
+ auto now = kgettimeofday().to_truncated_seconds();
e2inode.i_mode = mode;
e2inode.i_uid = uid;
e2inode.i_gid = gid;
e2inode.i_size = 0;
- e2inode.i_atime = now.tv_sec;
- e2inode.i_ctime = now.tv_sec;
- e2inode.i_mtime = now.tv_sec;
+ e2inode.i_atime = now;
+ e2inode.i_ctime = now;
+ e2inode.i_mtime = now;
e2inode.i_dtime = 0;
e2inode.i_flags = 0;