diff options
author | Andreas Kling <kling@serenityos.org> | 2023-03-06 19:29:25 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-07 00:30:12 +0100 |
commit | d1371d66f79d7482b4fe1acd58803c0a5db734f4 (patch) | |
tree | 98ead3246508f60971ceebf8478f0f22ebb7d98c /Kernel/Coredump.cpp | |
parent | 36b0ecfe9e28c00f12cde7add7330c4ec8cf3339 (diff) | |
download | serenity-d1371d66f79d7482b4fe1acd58803c0a5db734f4.zip |
Kernel: Use non-locking {Nonnull,}RefPtr for OpenFileDescription
This patch switches away from {Nonnull,}LockRefPtr to the non-locking
smart pointers throughout the kernel.
I've looked at the handful of places where these were being persisted
and I don't see any race situations.
Note that the process file descriptor table (Process::m_fds) was already
guarded via MutexProtected.
Diffstat (limited to 'Kernel/Coredump.cpp')
-rw-r--r-- | Kernel/Coredump.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Coredump.cpp b/Kernel/Coredump.cpp index 15e444763e..ccc0131ea4 100644 --- a/Kernel/Coredump.cpp +++ b/Kernel/Coredump.cpp @@ -74,7 +74,7 @@ ErrorOr<NonnullOwnPtr<Coredump>> Coredump::try_create(NonnullLockRefPtr<Process> return adopt_nonnull_own_or_enomem(new (nothrow) Coredump(move(process), move(description), move(regions))); } -Coredump::Coredump(NonnullLockRefPtr<Process> process, NonnullLockRefPtr<OpenFileDescription> description, Vector<FlatRegionData> regions) +Coredump::Coredump(NonnullLockRefPtr<Process> process, NonnullRefPtr<OpenFileDescription> description, Vector<FlatRegionData> regions) : m_process(move(process)) , m_description(move(description)) , m_regions(move(regions)) @@ -93,7 +93,7 @@ Coredump::Coredump(NonnullLockRefPtr<Process> process, NonnullLockRefPtr<OpenFil ++m_num_program_headers; // +1 for NOTE segment } -ErrorOr<NonnullLockRefPtr<OpenFileDescription>> Coredump::try_create_target_file(Process const& process, StringView output_path) +ErrorOr<NonnullRefPtr<OpenFileDescription>> Coredump::try_create_target_file(Process const& process, StringView output_path) { auto output_directory = KLexicalPath::dirname(output_path); auto dump_directory = TRY(VirtualFileSystem::the().open_directory(Process::current().credentials(), output_directory, VirtualFileSystem::the().root_custody())); |