Avoid taking proctree_lock and searching parents in wrappers if not needed.

This should help the case where filemon is loaded but not in use.

Sponsored by:	EMC / Isilon Storage Division
MFC after:	2 weeks
This commit is contained in:
Bryan Drewery 2015-08-26 03:37:18 +00:00
parent 9fa45e4864
commit 8b64fa1e12

View file

@ -88,6 +88,10 @@ filemon_pid_check(struct proc *p)
struct filemon *filemon;
filemon_lock_read();
if (TAILQ_EMPTY(&filemons_inuse)) {
filemon_unlock_read();
return (NULL);
}
sx_slock(&proctree_lock);
while (p != initproc) {
TAILQ_FOREACH(filemon, &filemons_inuse, link) {