diff options
author | Andreas Kling <kling@serenityos.org> | 2022-08-21 01:04:35 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-08-21 12:25:14 +0200 |
commit | 728c3fbd14252bd746f97dbb5441063992074b6b (patch) | |
tree | 539c32ede90702ab3ef35b984addad93769db340 /Kernel/Syscalls/stat.cpp | |
parent | 5331d243c690c70e431e2f8d260eacab19946c2b (diff) | |
download | serenity-728c3fbd14252bd746f97dbb5441063992074b6b.zip |
Kernel: Use RefPtr instead of LockRefPtr for Custody
By protecting all the RefPtr<Custody> objects that may be accessed from
multiple threads at the same time (with spinlocks), we remove the need
for using LockRefPtr<Custody> (which is basically a RefPtr with a
built-in spinlock.)
Diffstat (limited to 'Kernel/Syscalls/stat.cpp')
-rw-r--r-- | Kernel/Syscalls/stat.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Kernel/Syscalls/stat.cpp b/Kernel/Syscalls/stat.cpp index 39eea5b7e9..89194d32d0 100644 --- a/Kernel/Syscalls/stat.cpp +++ b/Kernel/Syscalls/stat.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <AK/RefPtr.h> #include <Kernel/FileSystem/Custody.h> #include <Kernel/FileSystem/VirtualFileSystem.h> #include <Kernel/Library/NonnullLockRefPtrVector.h> @@ -29,7 +30,7 @@ ErrorOr<FlatPtr> Process::sys$stat(Userspace<Syscall::SC_stat_params const*> use auto path = TRY(get_syscall_path_argument(params.path)); - LockRefPtr<Custody> base; + RefPtr<Custody> base; if (params.dirfd == AT_FDCWD) { base = current_directory(); } else { |