forked from Bananymous/banan-os
Kernel: Remove the big inode lock
This moves locking to the inodes themselves which allows reducing lock times significantly. Main inodes (ext2 and tmpfs) still do contain a single big mutex that gets locked during operations but now we have the architecture to optimize these.
This commit is contained in:
@@ -73,6 +73,8 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<size_t> Pipe::read_impl(off_t, BAN::ByteSpan buffer)
|
||||
{
|
||||
LockGuard _(m_mutex);
|
||||
|
||||
while (m_buffer->empty())
|
||||
{
|
||||
if (m_writing_count == 0)
|
||||
@@ -95,6 +97,8 @@ namespace Kernel
|
||||
|
||||
BAN::ErrorOr<size_t> Pipe::write_impl(off_t, BAN::ConstByteSpan buffer)
|
||||
{
|
||||
LockGuard _(m_mutex);
|
||||
|
||||
while (m_buffer->full())
|
||||
{
|
||||
if (m_reading_count == 0)
|
||||
|
||||
Reference in New Issue
Block a user