Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

*** 1451,1461 **** int i; size_t nqcache; vmem_t *vmp, *cur, **vmpp; vmem_seg_t *vsp; vmem_freelist_t *vfp; ! uint32_t id = atomic_add_32_nv(&vmem_id, 1); if (vmem_vmem_arena != NULL) { vmp = vmem_alloc(vmem_vmem_arena, sizeof (vmem_t), vmflag & VM_KMFLAGS); } else { --- 1451,1461 ---- int i; size_t nqcache; vmem_t *vmp, *cur, **vmpp; vmem_seg_t *vsp; vmem_freelist_t *vfp; ! uint32_t id = atomic_inc_32_nv(&vmem_id); if (vmem_vmem_arena != NULL) { vmp = vmem_alloc(vmem_vmem_arena, sizeof (vmem_t), vmflag & VM_KMFLAGS); } else {
*** 1553,1563 **** *vmpp = vmp; mutex_exit(&vmem_list_lock); if (vmp->vm_cflags & VMC_POPULATOR) { ASSERT(vmem_populators < VMEM_INITIAL); ! vmem_populator[atomic_add_32_nv(&vmem_populators, 1) - 1] = vmp; mutex_enter(&vmp->vm_lock); (void) vmem_populate(vmp, vmflag | VM_PANIC); mutex_exit(&vmp->vm_lock); } --- 1553,1563 ---- *vmpp = vmp; mutex_exit(&vmem_list_lock); if (vmp->vm_cflags & VMC_POPULATOR) { ASSERT(vmem_populators < VMEM_INITIAL); ! vmem_populator[atomic_inc_32_nv(&vmem_populators) - 1] = vmp; mutex_enter(&vmp->vm_lock); (void) vmem_populate(vmp, vmflag | VM_PANIC); mutex_exit(&vmp->vm_lock); }