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

@@ -21,12 +21,10 @@
 /*
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 /*
  * The idea behind composition-based stacked filesystems is to add a
  * vnode to the stack of vnodes for each mount. These vnodes have their
  * own set of mount options and filesystem-specific functions, so they
  * can modify data or operations before they are passed along. Such a

@@ -287,11 +285,11 @@
                                 VN_RELE(vp);
                                 goto found_lnode;
                         }
                         lp = tlp;
                 }
-                atomic_add_32(&li->li_refct, 1);
+                atomic_inc_32(&li->li_refct);
                 vfsp = makelfsnode(vp->v_vfsp, li);
                 lp->lo_vnode = nvp;
                 VN_SET_VFS_TYPE_DEV(nvp, vfsp, vp->v_type, vp->v_rdev);
                 nvp->v_flag |= (vp->v_flag & (VNOMOUNT|VNOMAP|VDIROPEN));
                 vn_setops(nvp, lo_vnodeops);

@@ -630,11 +628,11 @@
 {
         vfs_t *vfsp = &lfs->lfs_vfs;
 
         ASSERT(MUTEX_HELD(&li->li_lfslock));
         ASSERT(vfsp->vfs_count > 1);
-        if (atomic_add_32_nv(&vfsp->vfs_count, -1) == 1)
+        if (atomic_dec_32_nv(&vfsp->vfs_count) == 1)
                 freelfsnode(lfs, li);
 }
 
 /*
  * Remove a lnode from the table

@@ -670,11 +668,11 @@
                 if (lt == lp) {
 #ifdef LODEBUG
                         lo_dprint(4, "freeing %p, vfsp %p\n",
                             vp, vp->v_vfsp);
 #endif
-                        atomic_add_32(&li->li_refct, -1);
+                        atomic_dec_32(&li->li_refct);
                         vfsp = vp->v_vfsp;
                         vn_invalid(vp);
                         if (vfsp != li->li_mountvfs) {
                                 mutex_enter(&li->li_lfslock);
                                 /*