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

@@ -22,12 +22,10 @@
 /*
  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #include <sys/systm.h>
 #include <sys/param.h>
 #include <sys/atomic.h>
 #include <sys/kmem.h>
 #include <sys/refstr.h>

@@ -55,14 +53,14 @@
 }
 
 void
 refstr_hold(refstr_t *rsp)
 {
-        atomic_add_32(&rsp->rs_refcnt, 1);
+        atomic_inc_32(&rsp->rs_refcnt);
 }
 
 void
 refstr_rele(refstr_t *rsp)
 {
-        if (atomic_add_32_nv(&rsp->rs_refcnt, -1) == 0)
+        if (atomic_dec_32_nv(&rsp->rs_refcnt) == 0)
                 kmem_free(rsp, (size_t)rsp->rs_size);
 }