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

@@ -424,11 +424,11 @@
 
                 *id = handler->zi_id = inject_next_id++;
                 handler->zi_spa = spa;
                 handler->zi_record = *record;
                 list_insert_tail(&inject_handlers, handler);
-                atomic_add_32(&zio_injection_enabled, 1);
+                atomic_inc_32(&zio_injection_enabled);
 
                 rw_exit(&inject_lock);
         }
 
         /*

@@ -501,11 +501,11 @@
         list_remove(&inject_handlers, handler);
         rw_exit(&inject_lock);
 
         spa_inject_delref(handler->zi_spa);
         kmem_free(handler, sizeof (inject_handler_t));
-        atomic_add_32(&zio_injection_enabled, -1);
+        atomic_dec_32(&zio_injection_enabled);
 
         return (0);
 }
 
 void