summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-11-23 20:50:22 +0100
committerAndreas Kling <kling@serenityos.org>2020-11-24 11:26:40 +0100
commit541579bc0433a8d46999d1a383ffc460b8f6ed02 (patch)
tree5b61b56ee14df036e68257b3836c1c0755b148c6 /Kernel/FileSystem
parent1dc480e097f6523bf84d0b08084b118824c77058 (diff)
downloadserenity-541579bc0433a8d46999d1a383ffc460b8f6ed02.zip
Kernel: Remove unnecessary SmapDisablers in FileDescription
Since we're using UserOrKernelBuffers, SMAP will be automatically disabled when we actually access the buffer later on. There's no need to disable it wholesale across the entire read/write operations.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/FileDescription.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/Kernel/FileSystem/FileDescription.cpp b/Kernel/FileSystem/FileDescription.cpp
index 31216fa78f..ae38eccacd 100644
--- a/Kernel/FileSystem/FileDescription.cpp
+++ b/Kernel/FileSystem/FileDescription.cpp
@@ -123,7 +123,6 @@ KResultOr<size_t> FileDescription::read(UserOrKernelBuffer& buffer, size_t count
new_offset += count;
if (new_offset.has_overflow())
return -EOVERFLOW;
- SmapDisabler disabler;
auto nread_or_error = m_file->read(*this, offset(), buffer, count);
if (!nread_or_error.is_error() && m_file->is_seekable())
m_current_offset += nread_or_error.value();
@@ -137,7 +136,6 @@ KResultOr<size_t> FileDescription::write(const UserOrKernelBuffer& data, size_t
new_offset += size;
if (new_offset.has_overflow())
return -EOVERFLOW;
- SmapDisabler disabler;
auto nwritten_or_error = m_file->write(*this, offset(), data, size);
if (!nwritten_or_error.is_error() && m_file->is_seekable())
m_current_offset += nwritten_or_error.value();