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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_subr2.c
          +++ new/usr/src/uts/common/fs/smbclnt/smbfs/smbfs_subr2.c
↓ open down ↓ 395 lines elided ↑ open up ↑
 396  396                  /*
 397  397                   * allocate and initialize a new smbnode
 398  398                   */
 399  399                  vnode_t *new_vp;
 400  400  
 401  401                  mutex_exit(&smbfreelist_lock);
 402  402  
 403  403                  np = kmem_cache_alloc(smbnode_cache, KM_SLEEP);
 404  404                  new_vp = vn_alloc(KM_SLEEP);
 405  405  
 406      -                atomic_add_long((ulong_t *)&smbnodenew, 1);
      406 +                atomic_inc_ulong((ulong_t *)&smbnodenew);
 407  407                  vp = new_vp;
 408  408          }
 409  409  
 410  410          /*
 411  411           * Allocate and copy the rpath we'll need below.
 412  412           */
 413  413          new_rpath = kmem_alloc(rplen + 1, KM_SLEEP);
 414  414          bcopy(rpath, new_rpath, rplen);
 415  415          new_rpath[rplen] = '\0';
 416  416  
↓ open down ↓ 603 lines elided ↑ open up ↑
1020 1020          vfsp = vp->v_vfsp;
1021 1021  
1022 1022          ASSERT(vp->v_count == 1);
1023 1023          ASSERT(np->r_count == 0);
1024 1024          ASSERT(np->r_mapcnt == 0);
1025 1025          ASSERT(np->r_secattr.vsa_aclentp == NULL);
1026 1026          ASSERT(np->r_cred == NULL);
1027 1027          ASSERT(np->n_rpath == NULL);
1028 1028          ASSERT(!(np->r_flags & RHASHED));
1029 1029          ASSERT(np->r_freef == NULL && np->r_freeb == NULL);
1030      -        atomic_add_long((ulong_t *)&smbnodenew, -1);
     1030 +        atomic_dec_ulong((ulong_t *)&smbnodenew);
1031 1031          vn_invalid(vp);
1032 1032          vn_free(vp);
1033 1033          kmem_cache_free(smbnode_cache, np);
1034 1034          VFS_RELE(vfsp);
1035 1035  }
1036 1036  
1037 1037  /*
1038 1038   * Flush all vnodes in this (or every) vfs.
1039 1039   * Used by nfs_sync and by nfs_unmount.
1040 1040   */
↓ open down ↓ 135 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX