1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

Kernel: Update atime/ctime/mtime timestamps atomically

Instead of having three separate APIs (one for each timestamp),
there's now only Inode::update_timestamps() and it takes 3x optional
timestamps. The non-empty timestamps are updated while holding the inode
mutex, and the outside world no longer has to look at intermediate
timestamp states.
This commit is contained in:
Andreas Kling 2022-08-22 13:34:22 +02:00
parent 35b2e9c663
commit 280694bb46
18 changed files with 34 additions and 109 deletions

View file

@ -74,7 +74,6 @@ public:
virtual ErrorOr<NonnullLockRefPtr<ProcFSExposedComponent>> lookup(StringView) { VERIFY_NOT_REACHED(); };
virtual ErrorOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const&, OpenFileDescription*) { return EROFS; }
virtual ErrorOr<void> truncate(u64) { return EPERM; }
virtual ErrorOr<void> set_mtime(time_t) { return ENOTIMPL; }
virtual mode_t required_mode() const { return 0444; }
virtual UserID owner_user() const { return 0; }
@ -201,7 +200,6 @@ private:
virtual ErrorOr<size_t> write_bytes(off_t, size_t, UserOrKernelBuffer const&, OpenFileDescription*) override final;
virtual mode_t required_mode() const override final { return 0644; }
virtual ErrorOr<void> truncate(u64) override final;
virtual ErrorOr<void> set_mtime(time_t) override final;
};
}