summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2023-05-26 14:08:40 +0300
committerAndreas Kling <kling@serenityos.org>2023-05-27 10:58:58 +0200
commit8142f7b19693434c20623b447b834442124c9549 (patch)
tree4b63b24da7c094961b5a5eb68ada1eeb35f2aff4 /Kernel
parent2ab657d3b54b71062d6afc923470d64f048cb387 (diff)
downloadserenity-8142f7b19693434c20623b447b834442124c9549.zip
Kernel: Mark sys$get_dir_entries as not needing the big lock
After examination of all overriden Inode::traverse_as_directory methods it seems like proper locking is already existing everywhere, so there's no need to take the big process lock anymore, as there's no access to shared process structures anyway.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/API/Syscall.h2
-rw-r--r--Kernel/Syscalls/get_dir_entries.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h
index e7c44f14ac..565b5e1fe2 100644
--- a/Kernel/API/Syscall.h
+++ b/Kernel/API/Syscall.h
@@ -86,7 +86,7 @@ enum class NeedsBigProcessLock {
S(ftruncate, NeedsBigProcessLock::No) \
S(futex, NeedsBigProcessLock::Yes) \
S(futimens, NeedsBigProcessLock::No) \
- S(get_dir_entries, NeedsBigProcessLock::Yes) \
+ S(get_dir_entries, NeedsBigProcessLock::No) \
S(get_root_session_id, NeedsBigProcessLock::No) \
S(get_stack_bounds, NeedsBigProcessLock::No) \
S(get_thread_name, NeedsBigProcessLock::No) \
diff --git a/Kernel/Syscalls/get_dir_entries.cpp b/Kernel/Syscalls/get_dir_entries.cpp
index 47929675ce..530eb575a8 100644
--- a/Kernel/Syscalls/get_dir_entries.cpp
+++ b/Kernel/Syscalls/get_dir_entries.cpp
@@ -11,7 +11,7 @@ namespace Kernel {
ErrorOr<FlatPtr> Process::sys$get_dir_entries(int fd, Userspace<void*> user_buffer, size_t user_size)
{
- VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
+ VERIFY_NO_PROCESS_BIG_LOCK(this);
TRY(require_promise(Pledge::stdio));
if (user_size > NumericLimits<ssize_t>::max())
return EINVAL;