Kernel: Move ProcFS related overrides in Process to ProcessProcFSTraits

This allows us to 1) let go of the Process when an inode is ref'ing for
ProcFSExposedComponent related reasons, and 2) change our ref/unref
implementation.
This commit is contained in:
sin-ack 2021-08-14 12:43:34 +00:00 committed by Andreas Kling
commit 2830a0ecda
Notes: sideshowbarker 2024-07-18 05:42:31 +09:00
7 changed files with 143 additions and 61 deletions

View file

@ -944,8 +944,9 @@ KResultOr<NonnullRefPtr<ProcFSExposedComponent>> ProcFSRootDirectory::lookup(Str
auto actual_pid = pid.value();
auto maybe_process = Process::from_pid(actual_pid);
if (maybe_process)
return maybe_process.release_nonnull();
if (maybe_process) {
return maybe_process->procfs_traits();
}
return ENOENT;
}