Kernel: Don't lock ProcFS mutex when calling traverse_as_directory

This is not needed, because when we are doing this traversing, functions
that are called from this function are using proper and more "atomic"
locking.
This commit is contained in:
Liav A 2023-05-26 13:20:10 +03:00 committed by Andreas Kling
commit 902dac7f5f
Notes: sideshowbarker 2024-07-17 00:16:31 +09:00

View file

@ -124,7 +124,6 @@ ErrorOr<void> ProcFSInode::traverse_as_root_directory(Function<ErrorOr<void>(Fil
ErrorOr<void> ProcFSInode::traverse_as_directory(Function<ErrorOr<void>(FileSystem::DirectoryEntryView const&)> callback) const
{
MutexLocker locker(procfs().m_lock);
if (m_type == Type::ProcessSubdirectory) {
VERIFY(m_associated_pid.has_value());
auto process = Process::from_pid_in_same_jail(m_associated_pid.value());
@ -174,7 +173,6 @@ ErrorOr<NonnullRefPtr<Inode>> ProcFSInode::lookup_as_root_directory(StringView n
ErrorOr<NonnullRefPtr<Inode>> ProcFSInode::lookup(StringView name)
{
MutexLocker locker(procfs().m_lock);
if (m_type == Type::ProcessSubdirectory) {
VERIFY(m_associated_pid.has_value());
auto process = Process::from_pid_in_same_jail(m_associated_pid.value());