mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:57:44 +00:00
Kernel: Stop using NonnullLockRefPtrVector
This commit is contained in:
parent
21db2b7b90
commit
7369d0ab5f
41 changed files with 90 additions and 109 deletions
|
@ -8,7 +8,6 @@
|
|||
#include <Kernel/FileSystem/Custody.h>
|
||||
#include <Kernel/FileSystem/OpenFileDescription.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Library/NonnullLockRefPtrVector.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <Kernel/Library/NonnullLockRefPtrVector.h>
|
||||
#include <Kernel/Memory/AnonymousVMObject.h>
|
||||
#include <Kernel/Memory/InodeVMObject.h>
|
||||
#include <Kernel/Memory/MemoryManager.h>
|
||||
|
@ -21,7 +20,7 @@ ErrorOr<FlatPtr> Process::sys$purge(int mode)
|
|||
return EPERM;
|
||||
size_t purged_page_count = 0;
|
||||
if (mode & PURGE_ALL_VOLATILE) {
|
||||
NonnullLockRefPtrVector<Memory::AnonymousVMObject> vmobjects;
|
||||
Vector<NonnullLockRefPtr<Memory::AnonymousVMObject>> vmobjects;
|
||||
{
|
||||
ErrorOr<void> result;
|
||||
Memory::MemoryManager::for_each_vmobject([&](auto& vmobject) {
|
||||
|
@ -40,11 +39,11 @@ ErrorOr<FlatPtr> Process::sys$purge(int mode)
|
|||
return result.release_error();
|
||||
}
|
||||
for (auto& vmobject : vmobjects) {
|
||||
purged_page_count += vmobject.purge();
|
||||
purged_page_count += vmobject->purge();
|
||||
}
|
||||
}
|
||||
if (mode & PURGE_ALL_CLEAN_INODE) {
|
||||
NonnullLockRefPtrVector<Memory::InodeVMObject> vmobjects;
|
||||
Vector<NonnullLockRefPtr<Memory::InodeVMObject>> vmobjects;
|
||||
{
|
||||
ErrorOr<void> result;
|
||||
Memory::MemoryManager::for_each_vmobject([&](auto& vmobject) {
|
||||
|
@ -63,7 +62,7 @@ ErrorOr<FlatPtr> Process::sys$purge(int mode)
|
|||
return result.release_error();
|
||||
}
|
||||
for (auto& vmobject : vmobjects) {
|
||||
purged_page_count += vmobject.release_all_clean_pages();
|
||||
purged_page_count += vmobject->release_all_clean_pages();
|
||||
}
|
||||
}
|
||||
return purged_page_count;
|
||||
|
|
|
@ -313,7 +313,7 @@ ErrorOr<FlatPtr> Process::sys$recvmsg(int sockfd, Userspace<struct msghdr*> user
|
|||
Vector<int> fdnums;
|
||||
for (auto& description : descriptions) {
|
||||
auto fd_allocation = TRY(m_fds.with_exclusive([](auto& fds) { return fds.allocate(); }));
|
||||
m_fds.with_exclusive([&](auto& fds) { fds[fd_allocation.fd].set(description, 0); });
|
||||
m_fds.with_exclusive([&](auto& fds) { fds[fd_allocation.fd].set(*description, 0); });
|
||||
fdnums.append(fd_allocation.fd);
|
||||
}
|
||||
TRY(try_add_cmsg(SOL_SOCKET, SCM_RIGHTS, fdnums.data(), fdnums.size() * sizeof(int)));
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include <AK/RefPtr.h>
|
||||
#include <Kernel/FileSystem/Custody.h>
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Library/NonnullLockRefPtrVector.h>
|
||||
#include <Kernel/Process.h>
|
||||
|
||||
namespace Kernel {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue