FreeBSD/sys/kern/subr_devstat.c
/*
 * Remove a devstat structure from the list of devices.
 */
Remove a devstat structure from the list of devices.
Remove a devstat structure from the list of devices .
void
devstat_remove_entry(struct devstat *ds)
{
	struct devstatlist *devstat_head;
	mtx_assert(&devstat_mutex, MA_NOTOWNED);
	if (ds == NULL)
		return;
	mtx_lock(&devstat_mutex);
	devstat_head = &device_statq;
	atomic_add_acq_int(&ds->sequence1, 1);
	if (ds->unit_number != -1) {
		devstat_num_devs--;
		STAILQ_REMOVE(devstat_head, ds, devstat, dev_links);
	}
	devstat_free(ds);
	devstat_generation++;
	mtx_unlock(&devstat_mutex);
}
void devstat_remove_entry ( struct devstat * ds ) { struct devstatlist * devstat_head ; mtx_assert ( & devstat_mutex , MA_NOTOWNED ) ; if ( ds == NULL ) return ; mtx_lock ( & devstat_mutex ) ; devstat_head = & device_statq ; atomic_add_acq_int ( & ds -> sequence1 , 1 ) ; if ( ds -> unit_number != -1 ) { devstat_num_devs -- ; STAILQ_REMOVE ( devstat_head , ds , devstat , dev_links ) ; } devstat_free ( ds ) ; devstat_generation ++ ; mtx_unlock ( & devstat_mutex ) ; }
Remove a devstat structure from the list of devices.
Remove a devstat structure from the list of devices .
/* Remove this entry from the devstat queue */