diff options
author | Andreas Kling <kling@serenityos.org> | 2022-01-29 01:22:28 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-29 02:17:06 +0100 |
commit | 8ebec2938cd43d16655404ba86b20c73bfb724a7 (patch) | |
tree | 66af99284c69870ffc150c4137dedf8811147f3a /Kernel/Syscalls/read.cpp | |
parent | 93e90e16c3857badd86991b8dcca4c5ebc3ed5a7 (diff) | |
download | serenity-8ebec2938cd43d16655404ba86b20c73bfb724a7.zip |
Kernel: Convert process file descriptor table to a SpinlockProtected
Instead of manually locking in the various member functions of
Process::OpenFileDescriptions, simply wrap it in a SpinlockProtected.
Diffstat (limited to 'Kernel/Syscalls/read.cpp')
-rw-r--r-- | Kernel/Syscalls/read.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Syscalls/read.cpp b/Kernel/Syscalls/read.cpp index 21916c7a57..a19106a7f5 100644 --- a/Kernel/Syscalls/read.cpp +++ b/Kernel/Syscalls/read.cpp @@ -12,9 +12,9 @@ namespace Kernel { using BlockFlags = Thread::FileBlocker::BlockFlags; -static ErrorOr<NonnullRefPtr<OpenFileDescription>> open_readable_file_description(Process::OpenFileDescriptions const& fds, int fd) +static ErrorOr<NonnullRefPtr<OpenFileDescription>> open_readable_file_description(auto& fds, int fd) { - auto description = TRY(fds.open_file_description(fd)); + auto description = TRY(fds.with([&](auto& fds) { return fds.open_file_description(fd); })); if (!description->is_readable()) return EBADF; if (description->is_directory()) |