sys/dev/disk/dm/dm_pdev.c
int
dm_pdev_decr(dm_pdev_t * dmp)
{
	KKASSERT(dmp != NULL);
	/*
	 * If this was last reference remove dmp from
	 * global list also.
	 */
	lockmgr(&dm_pdev_mutex, LK_EXCLUSIVE);

	if (--dmp->ref_cnt == 0) {
		SLIST_REMOVE(&dm_pdev_list, dmp, dm_pdev, next_pdev);
		lockmgr(&dm_pdev_mutex, LK_RELEASE);
		dm_pdev_rem(dmp);
		return 0;
	}
	lockmgr(&dm_pdev_mutex, LK_RELEASE);
	return 0;
}
/*
 * Decrement pdev reference counter if 0 remove it.
 */
Decrement pdev reference counter if 0 remove it.
Decrement pdev reference counter if 0 remove it .
int
dm_pdev_decr(dm_pdev_t * dmp)
{
	KKASSERT(dmp != NULL);
	lockmgr(&dm_pdev_mutex, LK_EXCLUSIVE);
	if (--dmp->ref_cnt == 0) {
		SLIST_REMOVE(&dm_pdev_list, dmp, dm_pdev, next_pdev);
		lockmgr(&dm_pdev_mutex, LK_RELEASE);
		dm_pdev_rem(dmp);
		return 0;
	}
	lockmgr(&dm_pdev_mutex, LK_RELEASE);
	return 0;
}
int dm_pdev_decr ( dm_pdev_t * dmp ) { KKASSERT ( dmp != NULL ) ; lockmgr ( & dm_pdev_mutex , LK_EXCLUSIVE ) ; if ( -- dmp -> ref_cnt == 0 ) { SLIST_REMOVE ( & dm_pdev_list , dmp , dm_pdev , next_pdev ) ; lockmgr ( & dm_pdev_mutex , LK_RELEASE ) ; dm_pdev_rem ( dmp ) ; return 0 ; } lockmgr ( & dm_pdev_mutex , LK_RELEASE ) ; return 0 ; }
Decrement pdev reference counter if 0 remove it.
Decrement pdev reference counter if 0 remove it .
/*
	 * If this was last reference remove dmp from
	 * global list also.
	 */