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

Kernel/Ext2: Check and set file system state

This is supposed to detect whether a file system was unmounted
cleanly or not.
This commit is contained in:
kleines Filmröllchen 2023-07-02 14:25:16 +02:00 committed by Jelle Raaijmakers
parent 8fb126bec6
commit 251b17085b
2 changed files with 30 additions and 3 deletions

View file

@ -30,6 +30,7 @@ FileSystem::~FileSystem()
ErrorOr<void> FileSystem::prepare_to_unmount(Inode& mount_guest_inode)
{
return m_attach_count.with([&](auto& attach_count) -> ErrorOr<void> {
dbgln_if(VFS_DEBUG, "VFS: File system {} (id {}) is attached {} time(s)", class_name(), m_fsid.value(), attach_count);
if (attach_count == 1)
return prepare_to_clear_last_mount(mount_guest_inode);
return {};