Kernel: All devices have atime, mtime, ctime at their creation
This commit is contained in:
parent
5d5487315f
commit
a513bc5749
|
@ -19,9 +19,17 @@ namespace Kernel
|
|||
DeviceController
|
||||
};
|
||||
|
||||
Device();
|
||||
virtual ~Device() {}
|
||||
virtual DeviceType device_type() const = 0;
|
||||
virtual void update() {}
|
||||
|
||||
virtual timespec atime() const override { return m_create_time; }
|
||||
virtual timespec mtime() const override { return m_create_time; }
|
||||
virtual timespec ctime() const override { return m_create_time; }
|
||||
|
||||
private:
|
||||
timespec m_create_time;
|
||||
};
|
||||
|
||||
class BlockDevice : public Device
|
||||
|
|
|
@ -19,14 +19,10 @@ namespace Kernel::Input
|
|||
virtual uid_t uid() const override { return 0; }
|
||||
virtual gid_t gid() const override { return 0; }
|
||||
virtual off_t size() const override { return 0; }
|
||||
virtual timespec atime() const override { return m_time; }
|
||||
virtual timespec mtime() const override { return m_time; }
|
||||
virtual timespec ctime() const override { return m_time; }
|
||||
virtual blkcnt_t blocks() const override { return 0; }
|
||||
virtual dev_t dev() const override { return m_dev; }
|
||||
|
||||
private:
|
||||
timespec m_time;
|
||||
ino_t m_ino;
|
||||
dev_t m_dev;
|
||||
};
|
||||
|
|
|
@ -337,7 +337,6 @@ namespace Kernel::Input
|
|||
{
|
||||
m_dev = dev;
|
||||
m_ino = dev & 1;
|
||||
m_time = { BAN::to_unix_time(RTC::get_current_time()), 0 };
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue