Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 21,32 ****
/*
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
- #pragma ident "%Z%%M% %I% %E% SMI"
-
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/param.h>
#include <sys/atomic.h>
#include <sys/kmem.h>
--- 21,30 ----
*** 103,119 ****
}
void
corectl_content_hold(corectl_content_t *ccp)
{
! atomic_add_32(&ccp->ccc_refcnt, 1);
}
void
corectl_content_rele(corectl_content_t *ccp)
{
! if (atomic_add_32_nv(&ccp->ccc_refcnt, -1) == 0)
kmem_free(ccp, sizeof (corectl_content_t));
}
static corectl_path_t *
--- 101,117 ----
}
void
corectl_content_hold(corectl_content_t *ccp)
{
! atomic_inc_32(&ccp->ccc_refcnt);
}
void
corectl_content_rele(corectl_content_t *ccp)
{
! if (atomic_dec_32_nv(&ccp->ccc_refcnt) == 0)
kmem_free(ccp, sizeof (corectl_content_t));
}
static corectl_path_t *
*** 152,168 ****
}
void
corectl_path_hold(corectl_path_t *ccp)
{
! atomic_add_32(&ccp->ccp_refcnt, 1);
}
void
corectl_path_rele(corectl_path_t *ccp)
{
! if (atomic_add_32_nv(&ccp->ccp_refcnt, -1) == 0) {
refstr_rele(ccp->ccp_path);
kmem_free(ccp, sizeof (corectl_path_t));
}
}
--- 150,166 ----
}
void
corectl_path_hold(corectl_path_t *ccp)
{
! atomic_inc_32(&ccp->ccp_refcnt);
}
void
corectl_path_rele(corectl_path_t *ccp)
{
! if (atomic_dec_32_nv(&ccp->ccp_refcnt) == 0) {
refstr_rele(ccp->ccp_path);
kmem_free(ccp, sizeof (corectl_path_t));
}
}