summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-04-09 22:49:20 +0300
committerAndreas Kling <kling@serenityos.org>2022-04-09 23:46:02 +0200
commit9547a8e8a291b7b3f7a633fe835be8031f4f6d5d (patch)
treec2e41e738be215ca5168febbd09e981014e2c0e1
parent02973499222e40364734c45f90261d0f43c25dab (diff)
downloadserenity-9547a8e8a291b7b3f7a633fe835be8031f4f6d5d.zip
Kernel: Remove big lock from sys$close
This syscall doesn't access any unprotected shared data.
-rw-r--r--Kernel/API/Syscall.h2
-rw-r--r--Kernel/Syscalls/open.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/API/Syscall.h b/Kernel/API/Syscall.h
index 083ae84b52..45cc3ed771 100644
--- a/Kernel/API/Syscall.h
+++ b/Kernel/API/Syscall.h
@@ -54,7 +54,7 @@ enum class NeedsBigProcessLock {
S(clock_gettime, NeedsBigProcessLock::No) \
S(clock_nanosleep, NeedsBigProcessLock::No) \
S(clock_settime, NeedsBigProcessLock::No) \
- S(close, NeedsBigProcessLock::Yes) \
+ S(close, NeedsBigProcessLock::No) \
S(connect, NeedsBigProcessLock::Yes) \
S(create_inode_watcher, NeedsBigProcessLock::Yes) \
S(create_thread, NeedsBigProcessLock::Yes) \
diff --git a/Kernel/Syscalls/open.cpp b/Kernel/Syscalls/open.cpp
index 46f654753c..941722ba85 100644
--- a/Kernel/Syscalls/open.cpp
+++ b/Kernel/Syscalls/open.cpp
@@ -69,7 +69,7 @@ ErrorOr<FlatPtr> Process::sys$open(Userspace<Syscall::SC_open_params const*> use
ErrorOr<FlatPtr> Process::sys$close(int fd)
{
- VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this)
+ VERIFY_NO_PROCESS_BIG_LOCK(this)
TRY(require_promise(Pledge::stdio));
auto description = TRY(open_file_description(fd));
auto result = description->close();