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

@@ -22,12 +22,10 @@
 /*
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident   "%Z%%M% %I%     %E% SMI"
-
 #include <fs/fs_subr.h>
 
 #include <sys/errno.h>
 #include <sys/file.h>
 #include <sys/kmem.h>

@@ -251,11 +249,11 @@
 
         /*
          * No need for the lock, no other thread can be accessing
          * this data structure.
          */
-        atomic_add_32(&sft->sharefs_refs, 1);
+        atomic_inc_32(&sft->sharefs_refs);
         sft->sharefs_real_vp = 0;
 
         /*
          * Since the sharetab could easily change on us whilst we
          * are dumping an extremely huge sharetab, we make a copy

@@ -283,11 +281,11 @@
                         sft->sharefs_size = 0;
                         sft->sharefs_snap = NULL;
                         sft->sharefs_generation = 0;
                 }
         }
-        atomic_add_32(&sft->sharefs_refs, -1);
+        atomic_dec_32(&sft->sharefs_refs);
         rw_exit(&sharefs_lock);
 
         return (0);
 }