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/spd.c
          +++ new/usr/src/uts/common/inet/ip/spd.c
↓ open down ↓ 3255 lines elided ↑ open up ↑
3256 3256          for (;;) {
3257 3257                  ipsec_action_t *np = ap->ipa_next;
3258 3258                  ASSERT(ap->ipa_refs == 0);
3259 3259                  ASSERT(ap->ipa_hash.hash_pp == NULL);
3260 3260                  kmem_cache_free(ipsec_action_cache, ap);
3261 3261                  ap = np;
3262 3262                  /* Inlined IPACT_REFRELE -- avoid recursion */
3263 3263                  if (ap == NULL)
3264 3264                          break;
3265 3265                  membar_exit();
3266      -                if (atomic_add_32_nv(&(ap)->ipa_refs, -1) != 0)
     3266 +                if (atomic_dec_32_nv(&(ap)->ipa_refs) != 0)
3267 3267                          break;
3268 3268                  /* End inlined IPACT_REFRELE */
3269 3269          }
3270 3270  }
3271 3271  
3272 3272  /*
3273 3273   * Called when the action hash table goes away.
3274 3274   *
3275 3275   * The actions can be queued on an mblk with ipsec_in or
3276 3276   * ipsec_out, hence the actions might still be around.
↓ open down ↓ 3635 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX