1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

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
parent 748938ea59
commit 2830a0ecda
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;
}