Kernel: Make F11 drop disk cache

This can be useful to detect memory leaks or something
This commit is contained in:
2025-08-31 00:36:59 +03:00
parent 791a541381
commit da39e98adf
5 changed files with 55 additions and 0 deletions

View File

@@ -216,6 +216,14 @@ namespace Kernel
m_disk_cache.emplace(sector_size(), *this);
}
size_t StorageDevice::drop_disk_cache()
{
LockGuard _(m_mutex);
if (m_disk_cache.has_value())
return m_disk_cache->release_pages(-1);
return 0;
}
BAN::ErrorOr<void> StorageDevice::sync_disk_cache()
{
LockGuard _(m_mutex);