kernel - Make numerous proc accesses use p->p_token instead of proc_token.
* pfind() zpfind() now returns a referenced proc structure, callers must
release the proc with PRELE(). Callers no longer need to hold proc_token
for stable access.
* Enhance pgrp, adding pgrp->pg_token and pgrp->pg_refs in addition to
pgrp->pg_lock. The lock is used to interlock races between fork() and
signals while the token and refs are used to control access.
* Add pfindn(), a version of pfind() which does not ref the returned proc.
Some code still uses it (linux emulation) ---> needs work.
* Add pgref() and pgrel() to mess with the pgrp's pg_refs. pgrel()
automatically destroys the pgrp when the last reference goes away.
* Most process group operations now use the per-process token instead of
proc_token, though pgfind() still needs it temporarily.
* pgfind() now returns a referenced pgrp or NULL.
* Interlock signal handling with p->p_token instead of proc_token.
* Adjust most nice/priority functions to use the per-process token.
* Add protective PHOLD()s in various places in the signal code, the
ptrace code, and procfs.
* Change funsetown() to take the address of the sigio pointer to match
fsetown(), add sanity assertions.
* pgrp's in tty sessions are now ref-counted.
37 files changed: