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

@@ -25,12 +25,10 @@
  */
 
 #ifndef _SYS_SOCKFS_NL7CURI_H
 #define _SYS_SOCKFS_NL7CURI_H
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #ifdef  __cplusplus
 extern "C" {
 #endif
 
 #include <sys/types.h>

@@ -81,16 +79,16 @@
         (container)->ref.last = (void (*)(void *))((inactive));         \
         (container)->ref.kmc = (kmem);                                  \
 }
 
 #define REF_HOLD(container) {                                           \
-        atomic_add_32(&(container)->ref.cnt, 1);                        \
+        atomic_inc_32(&(container)->ref.cnt);                   \
         ASSERT((container)->ref.cnt != 0);                              \
 }
 
 #define REF_RELE(container) {                                           \
-        if (atomic_add_32_nv(&(container)->ref.cnt, -1) == 0) {         \
+        if (atomic_dec_32_nv(&(container)->ref.cnt) == 0) {             \
                 (container)->ref.last((container));                     \
                 kmem_cache_free((container)->ref.kmc, (container));     \
         }                                                               \
 }