Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -406,11 +406,11 @@
VN_HOLD(vp);
/* add it to the handle hash */
lhp->lh_next = ldi_handle_hash[index];
ldi_handle_hash[index] = lhp;
- atomic_add_long(&ldi_handle_hash_count, 1);
+ atomic_inc_ulong(&ldi_handle_hash_count);
LDI_ALLOCFREE((CE_WARN, "ldi handle alloc: new "
"lh=0x%p, ident=0x%p, vp=0x%p, drv=%s, minor=0x%x",
(void *)lhp, (void *)ident, (void *)vp,
mod_major_to_name(getmajor(vp->v_rdev)),
@@ -446,11 +446,11 @@
/* this was the last reference/open for this handle. free it. */
lhpp = handle_find_ref_nolock(lhp->lh_vp, lhp->lh_ident);
ASSERT((lhpp != NULL) && (*lhpp != NULL));
*lhpp = lhp->lh_next;
- atomic_add_long(&ldi_handle_hash_count, -1);
+ atomic_dec_ulong(&ldi_handle_hash_count);
mutex_exit(&ldi_handle_hash_lock[index]);
VN_RELE(lhp->lh_vp);
ident_release(lhp->lh_ident);
#ifdef LDI_OBSOLETE_EVENT