summaryrefslogtreecommitdiff
path: root/Kernel/Syscalls/mmap.cpp
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2021-06-22 21:22:17 +0300
committerAndreas Kling <kling@serenityos.org>2021-06-29 20:53:59 +0200
commit7c87891c06e37f217b5fde17a3fc869306da659b (patch)
tree3017e40cfb6fbbd01e1f0b36b483003d498c189c /Kernel/Syscalls/mmap.cpp
parent12b6e6915034a0c0d1981caf419a35c0a8cd247e (diff)
downloadserenity-7c87891c06e37f217b5fde17a3fc869306da659b.zip
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.
Diffstat (limited to 'Kernel/Syscalls/mmap.cpp')
-rw-r--r--Kernel/Syscalls/mmap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Syscalls/mmap.cpp b/Kernel/Syscalls/mmap.cpp
index 79353249ae..f88bc4d51e 100644
--- a/Kernel/Syscalls/mmap.cpp
+++ b/Kernel/Syscalls/mmap.cpp
@@ -224,7 +224,7 @@ KResultOr<FlatPtr> Process::sys$mmap(Userspace<const Syscall::SC_mmap_params*> u
return EINVAL;
if (static_cast<size_t>(offset) & ~PAGE_MASK)
return EINVAL;
- auto description = file_description(fd);
+ auto description = fds().file_description(fd);
if (!description)
return EBADF;
if (description->is_directory())