Kernel: Lock process functions instead of the ata controller

Process has to use locks at least on some functions so multithreaded
disk io is safe. This seemed to fix corrupted reads from disk
This commit is contained in:
Bananymous
2023-03-24 01:17:39 +02:00
parent e5eab8bae4
commit 5fd26b4ea8
4 changed files with 18 additions and 9 deletions

View File

@@ -4,6 +4,7 @@
#include <BAN/StringView.h>
#include <BAN/Vector.h>
#include <kernel/FS/Inode.h>
#include <kernel/SpinLock.h>
#include <kernel/Thread.h>
namespace Kernel
@@ -60,6 +61,8 @@ namespace Kernel
BAN::Vector<OpenFileDescription> m_open_files;
mutable SpinLock m_lock;
pid_t m_pid = 0;
BAN::String m_working_directory;
BAN::Vector<BAN::RefPtr<Thread>> m_threads;

View File

@@ -1,7 +1,6 @@
#pragma once
#include <BAN/Errors.h>
#include <kernel/SpinLock.h>
#include <kernel/Storage/StorageController.h>
namespace Kernel
@@ -68,7 +67,6 @@ namespace Kernel
BAN::ErrorOr<void> write(ATADevice*, uint64_t, uint8_t, const uint8_t*);
private:
SpinLock m_lock;
ATABus m_buses[2];
const PCIDevice& m_pci_device;