Kernel: Remove Process::all_processes()

This was only used in ProcFS, which can use the `processes()` list just
as well, so let's remove it.
This commit is contained in:
Idan Horowitz 2021-12-29 00:41:05 +02:00 committed by Andreas Kling
parent 81e23617d6
commit 3d0b5efcfc
Notes: sideshowbarker 2024-07-17 22:01:13 +09:00
3 changed files with 4 additions and 16 deletions

View file

@ -533,10 +533,11 @@ private:
{
{
auto array = json.add_array("processes");
auto processes = Process::all_processes();
build_process(array, *Scheduler::colonel());
for (auto& process : processes)
build_process(array, process);
processes().with([&](auto& processes) {
for (auto& process : processes)
build_process(array, process);
});
}
auto total_time_scheduled = Scheduler::get_total_time_scheduled();

View file

@ -79,17 +79,6 @@ UNMAP_AFTER_INIT void Process::initialize()
create_signal_trampoline();
}
NonnullRefPtrVector<Process> Process::all_processes()
{
NonnullRefPtrVector<Process> output;
processes().with([&](const auto& list) {
output.ensure_capacity(list.size_slow());
for (const auto& process : list)
output.append(NonnullRefPtr<Process>(process));
});
return output;
}
bool Process::in_group(GroupID gid) const
{
return this->gid() == gid || extra_gids().contains_slow(gid);

View file

@ -186,8 +186,6 @@ public:
bool unref() const;
~Process();
static NonnullRefPtrVector<Process> all_processes();
RefPtr<Thread> create_kernel_thread(void (*entry)(void*), void* entry_data, u32 priority, NonnullOwnPtr<KString> name, u32 affinity = THREAD_AFFINITY_DEFAULT, bool joinable = true);
bool is_profiling() const { return m_profiling; }