Kernel: Don't sync ext2 inode on read

This is the most common operation and we don't even update any fields
during read (although we should update atime). The disk read+write is a
bit too heavy with the current cache system
This commit is contained in:
2026-05-20 02:14:40 +03:00
parent 94f92d982c
commit a3ca49ff1f

View File

@@ -230,13 +230,11 @@ namespace Kernel
if (static_cast<BAN::make_unsigned_t<decltype(offset)>>(offset) >= UINT32_MAX || buffer.size() >= UINT32_MAX || buffer.size() >= (size_t)(UINT32_MAX - offset))
return BAN::Error::from_errno(EOVERFLOW);
RWLockRDGuard _0(m_lock);
RWLockRDGuard _(m_lock);
if (static_cast<BAN::make_unsigned_t<decltype(offset)>>(offset) >= static_cast<size_t>(m_size))
return 0;
ScopedSync _1(*this);
uint32_t count = buffer.size();
if (offset + buffer.size() > static_cast<size_t>(m_size))
count = m_size - offset;
@@ -283,7 +281,7 @@ namespace Kernel
if (static_cast<size_t>(m_size) < offset + buffer.size())
TRY(truncate_impl(offset + buffer.size()));
ScopedSync _(*this);
ScopedSync _1(*this);
const uint32_t block_size = blksize();