mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:58:11 +00:00
Kernel: Remove redundant disk cache dirty flag in BlockBasedFileSystem
The disk cache is dirty if the dirty list has entries. No need to track this in a separate flag.
This commit is contained in:
parent
a99685ece7
commit
01823746e3
1 changed files with 1 additions and 5 deletions
|
@ -34,20 +34,17 @@ public:
|
||||||
|
|
||||||
~DiskCache() = default;
|
~DiskCache() = default;
|
||||||
|
|
||||||
bool is_dirty() const { return m_dirty; }
|
bool is_dirty() const { return !m_dirty_list.is_empty(); }
|
||||||
void set_dirty(bool b) { m_dirty = b; }
|
|
||||||
|
|
||||||
void mark_all_clean()
|
void mark_all_clean()
|
||||||
{
|
{
|
||||||
while (auto* entry = m_dirty_list.first())
|
while (auto* entry = m_dirty_list.first())
|
||||||
m_clean_list.prepend(*entry);
|
m_clean_list.prepend(*entry);
|
||||||
m_dirty = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mark_dirty(CacheEntry& entry)
|
void mark_dirty(CacheEntry& entry)
|
||||||
{
|
{
|
||||||
m_dirty_list.prepend(entry);
|
m_dirty_list.prepend(entry);
|
||||||
m_dirty = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void mark_clean(CacheEntry& entry)
|
void mark_clean(CacheEntry& entry)
|
||||||
|
@ -101,7 +98,6 @@ private:
|
||||||
mutable IntrusiveList<&CacheEntry::list_node> m_dirty_list;
|
mutable IntrusiveList<&CacheEntry::list_node> m_dirty_list;
|
||||||
NonnullOwnPtr<KBuffer> m_cached_block_data;
|
NonnullOwnPtr<KBuffer> m_cached_block_data;
|
||||||
NonnullOwnPtr<KBuffer> m_entries;
|
NonnullOwnPtr<KBuffer> m_entries;
|
||||||
bool m_dirty { false };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
BlockBasedFileSystem::BlockBasedFileSystem(OpenFileDescription& file_description)
|
BlockBasedFileSystem::BlockBasedFileSystem(OpenFileDescription& file_description)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue