Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -8090,11 +8090,11 @@
*/
(*cp->callbacks.cbo_umem_lock_cleanup)((ddi_umem_cookie_t)cp);
/* remove the cookie if reference goes to zero */
- if (atomic_add_long_nv((ulong_t *)(&(cp->cook_refcnt)), -1) == 0) {
+ if (atomic_dec_ulong_nv((ulong_t *)(&(cp->cook_refcnt))) == 0) {
kmem_free(cp, sizeof (struct ddi_umem_cookie));
}
}
/*
@@ -8485,11 +8485,11 @@
* memory if the reference count goes to zero. The only
* other value for rc is AS_CALLBACK_NOTFOUND. In that
* case, just return the cookie memory.
*/
if ((rc != AS_CALLBACK_DELETE_DEFERRED) ||
- (atomic_add_long_nv((ulong_t *)(&(p->cook_refcnt)), -1)
+ (atomic_dec_ulong_nv((ulong_t *)(&(p->cook_refcnt)))
== 0)) {
kmem_free(p, sizeof (struct ddi_umem_cookie));
}
}
}