Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*
*** 424,434 ****
*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);
rw_exit(&inject_lock);
}
/*
--- 424,434 ----
*id = handler->zi_id = inject_next_id++;
handler->zi_spa = spa;
handler->zi_record = *record;
list_insert_tail(&inject_handlers, handler);
! atomic_inc_32(&zio_injection_enabled);
rw_exit(&inject_lock);
}
/*
*** 501,511 ****
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);
return (0);
}
void
--- 501,511 ----
list_remove(&inject_handlers, handler);
rw_exit(&inject_lock);
spa_inject_delref(handler->zi_spa);
kmem_free(handler, sizeof (inject_handler_t));
! atomic_dec_32(&zio_injection_enabled);
return (0);
}
void