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/ip_if.c
          +++ new/usr/src/uts/common/inet/ip/ip_if.c
↓ open down ↓ 11768 lines elided ↑ open up ↑
11769 11769  
11770 11770  /*
11771 11771   * Assign a unique id for the ipif. This is used by sctp_addr.c
11772 11772   * Note: remove if sctp_addr.c is redone to not shadow ill/ipif data structures.
11773 11773   */
11774 11774  static void
11775 11775  ipif_assign_seqid(ipif_t *ipif)
11776 11776  {
11777 11777          ip_stack_t      *ipst = ipif->ipif_ill->ill_ipst;
11778 11778  
11779      -        ipif->ipif_seqid = atomic_add_64_nv(&ipst->ips_ipif_g_seqid, 1);
     11779 +        ipif->ipif_seqid = atomic_inc_64_nv(&ipst->ips_ipif_g_seqid);
11780 11780  }
11781 11781  
11782 11782  /*
11783 11783   * Clone the contents of `sipif' to `dipif'.  Requires that both ipifs are
11784 11784   * administratively down (i.e., no DAD), of the same type, and locked.  Note
11785 11785   * that the clone is complete -- including the seqid -- and the expectation is
11786 11786   * that the caller will either free or overwrite `sipif' before it's unlocked.
11787 11787   */
11788 11788  static void
11789 11789  ipif_clone(const ipif_t *sipif, ipif_t *dipif)
↓ open down ↓ 652 lines elided ↑ open up ↑
12442 12442  /*
12443 12443   * Redo source address selection.  This makes IXAF_VERIFY_SOURCE take
12444 12444   * a look again at valid source addresses.
12445 12445   * This should be called each time after the set of source addresses has been
12446 12446   * changed.
12447 12447   */
12448 12448  void
12449 12449  ip_update_source_selection(ip_stack_t *ipst)
12450 12450  {
12451 12451          /* We skip past SRC_GENERATION_VERIFY */
12452      -        if (atomic_add_32_nv(&ipst->ips_src_generation, 1) ==
     12452 +        if (atomic_inc_32_nv(&ipst->ips_src_generation) ==
12453 12453              SRC_GENERATION_VERIFY)
12454      -                atomic_add_32(&ipst->ips_src_generation, 1);
     12454 +                atomic_inc_32(&ipst->ips_src_generation);
12455 12455  }
12456 12456  
12457 12457  /*
12458 12458   * Finish the group join started in ip_sioctl_groupname().
12459 12459   */
12460 12460  /* ARGSUSED */
12461 12461  static void
12462 12462  ip_join_illgrps(ipsq_t *ipsq, queue_t *q, mblk_t *mp, void *dummy)
12463 12463  {
12464 12464          ill_t           *ill = q->q_ptr;
↓ open down ↓ 6676 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX