mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 22:38:51 +00:00
Add an inode metadata cache to the ext2fs implementation.
This commit is contained in:
parent
4259ffb080
commit
8e640539ef
Notes:
sideshowbarker
2024-07-19 18:36:42 +09:00
Author: https://github.com/awesomekling
Commit: 8e640539ef
7 changed files with 57 additions and 5 deletions
|
@ -46,6 +46,7 @@ ByteBuffer DiskBackedFileSystem::readBlock(unsigned index) const
|
|||
|
||||
#ifdef BLOCK_CACHE
|
||||
{
|
||||
LOCKER(m_blockCacheLock);
|
||||
InterruptDisabler disabler;
|
||||
auto it = m_blockCache.find(index);
|
||||
if (it != m_blockCache.end()) {
|
||||
|
@ -64,6 +65,7 @@ ByteBuffer DiskBackedFileSystem::readBlock(unsigned index) const
|
|||
|
||||
#ifdef BLOCK_CACHE
|
||||
{
|
||||
LOCKER(m_blockCacheLock);
|
||||
InterruptDisabler disabler;
|
||||
if (m_blockCache.size() >= 32)
|
||||
m_blockCache.removeOneRandomly();
|
||||
|
@ -103,6 +105,7 @@ void DiskBackedFileSystem::setBlockSize(unsigned blockSize)
|
|||
|
||||
void DiskBackedFileSystem::invalidateCaches()
|
||||
{
|
||||
LOCKER(m_blockCacheLock);
|
||||
InterruptDisabler disabler;
|
||||
m_blockCache.clear();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue