Kernel: Rework storage device and disk cache locking

Syncing the disk cache no longer blocks the underlying storage device
and the disk cache itself during sync
This commit is contained in:
2026-01-02 17:46:36 +02:00
parent 912c5ea0bf
commit 08bfa0971e
4 changed files with 53 additions and 26 deletions

View File

@@ -3,6 +3,7 @@
#include <BAN/Array.h>
#include <BAN/ByteSpan.h>
#include <BAN/Vector.h>
#include <kernel/Lock/RWLock.h>
#include <kernel/Memory/Types.h>
namespace Kernel
@@ -37,9 +38,13 @@ namespace Kernel
uint64_t first_sector { 0 };
uint8_t sector_mask { 0 };
uint8_t dirty_mask { 0 };
bool syncing { false };
};
private:
RWLock m_rw_lock;
Mutex m_sync_mutex;
const size_t m_sector_size;
StorageDevice& m_device;
BAN::Vector<PageCache> m_cache;

View File

@@ -51,7 +51,6 @@ namespace Kernel
virtual bool has_hungup_impl() const override { return false; }
private:
Mutex m_mutex;
BAN::Optional<DiskCache> m_disk_cache;
BAN::Vector<BAN::RefPtr<Partition>> m_partitions;