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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ip.h
          +++ new/usr/src/uts/common/inet/ip.h
↓ open down ↓ 712 lines elided ↑ open up ↑
 713  713  
 714  714          struct ipsid_s  *ipl_local_cid;
 715  715          struct ipsid_s  *ipl_remote_cid;
 716  716          unsigned int
 717  717                          ipl_ids_latched : 1,
 718  718  
 719  719                          ipl_pad_to_bit_31 : 31;
 720  720  } ipsec_latch_t;
 721  721  
 722  722  #define IPLATCH_REFHOLD(ipl) { \
 723      -        atomic_add_32(&(ipl)->ipl_refcnt, 1);           \
      723 +        atomic_inc_32(&(ipl)->ipl_refcnt);              \
 724  724          ASSERT((ipl)->ipl_refcnt != 0);                 \
 725  725  }
 726  726  
 727  727  #define IPLATCH_REFRELE(ipl) {                          \
 728  728          ASSERT((ipl)->ipl_refcnt != 0);                         \
 729  729          membar_exit();                                          \
 730      -        if (atomic_add_32_nv(&(ipl)->ipl_refcnt, -1) == 0)      \
      730 +        if (atomic_dec_32_nv(&(ipl)->ipl_refcnt) == 0)  \
 731  731                  iplatch_free(ipl);                              \
 732  732  }
 733  733  
 734  734  /*
 735  735   * peer identity structure.
 736  736   */
 737  737  typedef struct conn_s conn_t;
 738  738  
 739  739  /*
 740  740   * This is used to match an inbound/outbound datagram with policy.
↓ open down ↓ 3045 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX