Rework ptrace(2) to be more locking friendly.  We do any needed copyin()'s and acquire the proctree_lock if needed first.  Then we lock the process if necessary and fiddle with it as appropriate.  Finally we drop locks and do any needed copyout's.  This greatly simplifies the locking.
Rework ptrace(2) to be more locking friendly.  We do any needed copyin()'s
and acquire the proctree_lock if needed first.  Then we lock the process
if necessary and fiddle with it as appropriate.  Finally we drop locks and
do any needed copyout's.  This greatly simplifies the locking.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase