FreeBSD/sys/dev/filemon/filemon.c
/*
 * Release a reference and free on the last one.
 */
Release a reference and free on the last one.
Release a reference and free on the last one .
static void
filemon_release(struct filemon *filemon)
{
	if (refcount_release(&filemon->refcnt) == 0)
		return;
	sx_assert(&filemon->lock, SA_UNLOCKED);
	if (filemon->cred != NULL)
		crfree(filemon->cred);
	sx_destroy(&filemon->lock);
	free(filemon, M_FILEMON);
}
static void filemon_release ( struct filemon * filemon ) { if ( refcount_release ( & filemon -> refcnt ) == 0 ) return ; sx_assert ( & filemon -> lock , SA_UNLOCKED ) ; if ( filemon -> cred != NULL ) crfree ( filemon -> cred ) ; sx_destroy ( & filemon -> lock ) ; free ( filemon , M_FILEMON ) ; }
Release a reference and free on the last one.
Release a reference and free on the last one .
/*
	 * There are valid cases of releasing while locked, such as in
	 * filemon_untrack_processes, but none which are done where there
	 * is not at least 1 reference remaining.
	 */