1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Automatically call Inode::flush_metadata() before an Inode is destroyed.

Use a little template magic to have Retainable::release() call out to
T::will_be_destroyed() if such a function exists before actually calling
the destructor. This gives us full access to virtual functions in the
pre-destruction code.
This commit is contained in:
Andreas Kling 2018-12-19 22:28:09 +01:00
parent 1f44cd9dd9
commit d0f06e5f3f
6 changed files with 41 additions and 17 deletions

View file

@ -1104,7 +1104,7 @@ int Process::sys$utime(const char* pathname, const Unix::utimbuf* buf)
atime = now;
}
inode.set_atime(atime);
inode.set_mtime(atime);
inode.set_mtime(mtime);
inode.flush_metadata();
return 0;
}