/* * Destroy the vlan-id hash table for the given vsw device or port. */ static void vsw_vlan_destroy_hash(void *arg, int type) { if (type == VSW_LOCALDEV) { vsw_t *vswp = (vsw_t *)arg; mod_hash_destroy_hash(vswp->vlan_hashp); vswp->vlan_nchains = 0; } else if (type == VSW_VNETPORT) { vsw_port_t *portp = (vsw_port_t *)arg; mod_hash_destroy_hash(portp->vlan_hashp); portp->vlan_nchains = 0; } else { return; } }
int dls_vlan_fini(void) { if (i_dls_vlan_count > 0) return (EBUSY); /* * Destroy the hash table */ mod_hash_destroy_hash(i_dls_vlan_hash); rw_destroy(&i_dls_vlan_lock); /* * Destroy the kmem_cache. */ kmem_cache_destroy(i_dls_vlan_cachep); return (0); }