FreeBSD/sys/dev/filemon/filemon.c
/* Remove and release the filemon on the given process. */
Remove and release the filemon on the given process.
Remove and release the filemon on the given process .
static void
filemon_proc_drop(struct proc *p)
{
	struct filemon *filemon;
	KASSERT(p->p_filemon != NULL, ("%s: proc %p NULL p_filemon",
	    __func__, p));
	sx_assert(&p->p_filemon->lock, SA_XLOCKED);
	PROC_LOCK(p);
	filemon = p->p_filemon;
	p->p_filemon = NULL;
	--filemon->proccnt;
	PROC_UNLOCK(p);
	KASSERT(filemon->refcnt > 1, ("%s: proc %p dropping filemon %p "
	    "with last reference", __func__, p, filemon));
	filemon_release(filemon);
}
static void filemon_proc_drop ( struct proc * p ) { struct filemon * filemon ; KASSERT ( p -> p_filemon != NULL , ( " " , __func__ , p ) ) ; sx_assert ( & p -> p_filemon -> lock , SA_XLOCKED ) ; PROC_LOCK ( p ) ; filemon = p -> p_filemon ; p -> p_filemon = NULL ; -- filemon -> proccnt ; PROC_UNLOCK ( p ) ; KASSERT ( filemon -> refcnt > 1 , ( " " " " , __func__ , p , filemon ) ) ; filemon_release ( filemon ) ; }
Remove and release the filemon on the given process.
Remove and release the filemon on the given process .
/*
	 * This should not be the last reference yet.  filemon_release()
	 * cannot be called with filemon locked, which the caller expects
	 * will stay locked.
	 */