Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
@@ -232,30 +232,30 @@
kcondvar_t lg_port_cv;
int lg_port_ref;
} aggr_grp_t;
#define AGGR_GRP_REFHOLD(grp) { \
- atomic_add_32(&(grp)->lg_refs, 1); \
+ atomic_inc_32(&(grp)->lg_refs); \
ASSERT((grp)->lg_refs != 0); \
}
#define AGGR_GRP_REFRELE(grp) { \
ASSERT((grp)->lg_refs != 0); \
membar_exit(); \
- if (atomic_add_32_nv(&(grp)->lg_refs, -1) == 0) \
+ if (atomic_dec_32_nv(&(grp)->lg_refs) == 0) \
aggr_grp_free(grp); \
}
#define AGGR_PORT_REFHOLD(port) { \
- atomic_add_32(&(port)->lp_refs, 1); \
+ atomic_inc_32(&(port)->lp_refs); \
ASSERT((port)->lp_refs != 0); \
}
#define AGGR_PORT_REFRELE(port) { \
ASSERT((port)->lp_refs != 0); \
membar_exit(); \
- if (atomic_add_32_nv(&(port)->lp_refs, -1) == 0) \
+ if (atomic_dec_32_nv(&(port)->lp_refs) == 0) \
aggr_port_free(port); \
}
extern dev_info_t *aggr_dip;
extern int aggr_ioc_init(void);