mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
Kernel: Don't copy a Vector<FileDescriptionAndFlags>
Instead of copying a Vector everytime we need to enumerate a Process' file descriptions, we can just temporarily lock so it won't change.
This commit is contained in:
parent
12b6e69150
commit
7c87891c06
Notes:
sideshowbarker
2024-07-18 11:16:32 +09:00
Author: https://github.com/supercomputer7
Commit: 7c87891c06
Pull-request: https://github.com/SerenityOS/serenity/pull/7509
Reviewed-by: https://github.com/BertalanD
Reviewed-by: https://github.com/awesomekling
28 changed files with 198 additions and 128 deletions
|
@ -34,7 +34,7 @@ KResultOr<FlatPtr> Process::sys$readv(int fd, Userspace<const struct iovec*> iov
|
|||
return EINVAL;
|
||||
}
|
||||
|
||||
auto description = file_description(fd);
|
||||
auto description = fds().file_description(fd);
|
||||
if (!description)
|
||||
return EBADF;
|
||||
|
||||
|
@ -76,7 +76,7 @@ KResultOr<FlatPtr> Process::sys$read(int fd, Userspace<u8*> buffer, size_t size)
|
|||
if (size > NumericLimits<ssize_t>::max())
|
||||
return EINVAL;
|
||||
dbgln_if(IO_DEBUG, "sys$read({}, {}, {})", fd, buffer.ptr(), size);
|
||||
auto description = file_description(fd);
|
||||
auto description = fds().file_description(fd);
|
||||
if (!description)
|
||||
return EBADF;
|
||||
if (!description->is_readable())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue