1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:28:11 +00:00

Kernel: Remove create_inode_watcher syscall from the big lock

This commit is contained in:
Sam Atkins 2023-02-04 13:53:37 +00:00 committed by Andreas Kling
parent cc558d95f0
commit b26ecca970
2 changed files with 3 additions and 3 deletions

View file

@ -16,10 +16,9 @@ namespace Kernel {
ErrorOr<FlatPtr> Process::sys$create_inode_watcher(u32 flags)
{
VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this);
VERIFY_NO_PROCESS_BIG_LOCK(this);
TRY(require_promise(Pledge::rpath));
auto fd_allocation = TRY(allocate_fd());
auto watcher = TRY(InodeWatcher::try_create());
auto description = TRY(OpenFileDescription::try_create(move(watcher)));
@ -28,6 +27,7 @@ ErrorOr<FlatPtr> Process::sys$create_inode_watcher(u32 flags)
description->set_blocking(false);
return m_fds.with_exclusive([&](auto& fds) -> ErrorOr<FlatPtr> {
auto fd_allocation = TRY(fds.allocate());
fds[fd_allocation.fd].set(move(description));
if (flags & static_cast<unsigned>(InodeWatcherFlags::CloseOnExec))