mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
Kernel: Use the system boot time as default timestamp in /sys and /dev
This commit is contained in:
parent
adaaea4c9a
commit
4e4a930b13
Notes:
sideshowbarker
2024-07-17 10:14:05 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/4e4a930b13
@ -28,7 +28,7 @@ ErrorOr<void> DevPtsFS::initialize()
|
||||
m_root_inode->m_metadata.uid = 0;
|
||||
m_root_inode->m_metadata.gid = 0;
|
||||
m_root_inode->m_metadata.size = 0;
|
||||
m_root_inode->m_metadata.mtime = mepoch;
|
||||
m_root_inode->m_metadata.mtime = TimeManagement::boot_time();
|
||||
return {};
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ ErrorOr<NonnullRefPtr<Inode>> DevPtsFS::get_inode(InodeIdentifier inode_id) cons
|
||||
inode->m_metadata.mode = 0020600;
|
||||
inode->m_metadata.major_device = device->major();
|
||||
inode->m_metadata.minor_device = device->minor();
|
||||
inode->m_metadata.mtime = mepoch;
|
||||
inode->m_metadata.mtime = TimeManagement::boot_time();
|
||||
return inode;
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,7 @@ InodeMetadata DevTmpFSInode::metadata() const
|
||||
metadata.uid = m_uid;
|
||||
metadata.gid = m_gid;
|
||||
metadata.size = 0;
|
||||
metadata.mtime = mepoch;
|
||||
metadata.mtime = TimeManagement::boot_time();
|
||||
switch (node_type()) {
|
||||
case Type::RootDirectory:
|
||||
metadata.inode = { fsid(), 1 };
|
||||
@ -102,7 +102,7 @@ InodeMetadata DevTmpFSInode::metadata() const
|
||||
metadata.uid = 0;
|
||||
metadata.gid = 0;
|
||||
metadata.size = 0;
|
||||
metadata.mtime = mepoch;
|
||||
metadata.mtime = TimeManagement::boot_time();
|
||||
break;
|
||||
case Type::Directory:
|
||||
metadata.inode = { fsid(), index() };
|
||||
|
@ -18,8 +18,6 @@
|
||||
|
||||
namespace Kernel {
|
||||
|
||||
static constexpr u32 mepoch = 476763780;
|
||||
|
||||
class FileSystem : public RefCounted<FileSystem> {
|
||||
friend class Inode;
|
||||
|
||||
|
@ -138,7 +138,7 @@ InodeMetadata SysFSInode::metadata() const
|
||||
metadata.uid = 0;
|
||||
metadata.gid = 0;
|
||||
metadata.size = m_associated_component->size();
|
||||
metadata.mtime = mepoch;
|
||||
metadata.mtime = TimeManagement::boot_time();
|
||||
return metadata;
|
||||
}
|
||||
|
||||
@ -208,7 +208,7 @@ InodeMetadata SysFSDirectoryInode::metadata() const
|
||||
metadata.uid = 0;
|
||||
metadata.gid = 0;
|
||||
metadata.size = 0;
|
||||
metadata.mtime = mepoch;
|
||||
metadata.mtime = TimeManagement::boot_time();
|
||||
return metadata;
|
||||
}
|
||||
ErrorOr<void> SysFSDirectoryInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
|
||||
|
Loading…
Reference in New Issue
Block a user