1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

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.
This commit is contained in:
Andreas Kling 2022-01-29 01:22:28 +01:00
parent 93e90e16c3
commit 8ebec2938c
30 changed files with 257 additions and 190 deletions

View file

@ -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())