summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/stat.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-08-21 01:04:35 +0200
committerAndreas Kling <kling@serenityos.org>2022-08-21 12:25:14 +0200
commit728c3fbd14252bd746f97dbb5441063992074b6b (patch)
tree539c32ede90702ab3ef35b984addad93769db340 /Kernel/Syscalls/stat.cpp
parent5331d243c690c70e431e2f8d260eacab19946c2b (diff)
downloadserenity-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.cpp3
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 {