Lines Matching refs:handler

166 	inject_handler_t *handler;  in zio_handle_panic_injection()  local
170 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_panic_injection()
171 handler = list_next(&inject_handlers, handler)) { in zio_handle_panic_injection()
173 if (spa != handler->zi_spa) in zio_handle_panic_injection()
176 if (handler->zi_record.zi_type == type && in zio_handle_panic_injection()
177 strcmp(tag, handler->zi_record.zi_func) == 0) in zio_handle_panic_injection()
225 inject_handler_t *handler; in zio_handle_decrypt_injection() local
229 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_decrypt_injection()
230 handler = list_next(&inject_handlers, handler)) { in zio_handle_decrypt_injection()
232 if (spa != handler->zi_spa || in zio_handle_decrypt_injection()
233 handler->zi_record.zi_cmd != ZINJECT_DECRYPT_FAULT) in zio_handle_decrypt_injection()
237 &handler->zi_record, error)) { in zio_handle_decrypt_injection()
255 inject_handler_t *handler; in zio_handle_fault_injection() local
271 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_fault_injection()
272 handler = list_next(&inject_handlers, handler)) { in zio_handle_fault_injection()
274 if (zio->io_spa != handler->zi_spa || in zio_handle_fault_injection()
275 handler->zi_record.zi_cmd != ZINJECT_DATA_FAULT) in zio_handle_fault_injection()
281 zio_match_dva(zio), &handler->zi_record, error)) { in zio_handle_fault_injection()
301 inject_handler_t *handler; in zio_handle_label_injection() local
313 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_label_injection()
314 handler = list_next(&inject_handlers, handler)) { in zio_handle_label_injection()
315 uint64_t start = handler->zi_record.zi_start; in zio_handle_label_injection()
316 uint64_t end = handler->zi_record.zi_end; in zio_handle_label_injection()
318 if (handler->zi_record.zi_cmd != ZINJECT_LABEL_FAULT) in zio_handle_label_injection()
330 if (zio->io_vd->vdev_guid == handler->zi_record.zi_guid && in zio_handle_label_injection()
344 inject_handler_t *handler; in zio_handle_device_injection() local
361 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_device_injection()
362 handler = list_next(&inject_handlers, handler)) { in zio_handle_device_injection()
364 if (handler->zi_record.zi_cmd != ZINJECT_DEVICE_FAULT) in zio_handle_device_injection()
367 if (vd->vdev_guid == handler->zi_record.zi_guid) { in zio_handle_device_injection()
368 if (handler->zi_record.zi_failfast && in zio_handle_device_injection()
376 handler->zi_record.zi_iotype != ZIO_TYPES && in zio_handle_device_injection()
377 handler->zi_record.zi_iotype != zio->io_type) in zio_handle_device_injection()
380 if (handler->zi_record.zi_error == error) { in zio_handle_device_injection()
384 if (!freq_triggered(handler->zi_record.zi_freq)) in zio_handle_device_injection()
400 if (!handler->zi_record.zi_failfast && in zio_handle_device_injection()
407 if (handler->zi_record.zi_error == ENXIO) { in zio_handle_device_injection()
426 inject_handler_t *handler; in zio_handle_ignored_writes() local
430 for (handler = list_head(&inject_handlers); handler != NULL; in zio_handle_ignored_writes()
431 handler = list_next(&inject_handlers, handler)) { in zio_handle_ignored_writes()
434 if (zio->io_spa != handler->zi_spa || in zio_handle_ignored_writes()
435 handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) in zio_handle_ignored_writes()
442 if (handler->zi_record.zi_timer == 0) { in zio_handle_ignored_writes()
443 if (handler->zi_record.zi_duration > 0) in zio_handle_ignored_writes()
444 handler->zi_record.zi_timer = ddi_get_lbolt64(); in zio_handle_ignored_writes()
446 handler->zi_record.zi_timer = zio->io_txg; in zio_handle_ignored_writes()
461 inject_handler_t *handler; in spa_handle_ignored_writes() local
468 for (handler = list_head(&inject_handlers); handler != NULL; in spa_handle_ignored_writes()
469 handler = list_next(&inject_handlers, handler)) { in spa_handle_ignored_writes()
471 if (spa != handler->zi_spa || in spa_handle_ignored_writes()
472 handler->zi_record.zi_cmd != ZINJECT_IGNORED_WRITES) in spa_handle_ignored_writes()
475 if (handler->zi_record.zi_duration > 0) { in spa_handle_ignored_writes()
476 VERIFY(handler->zi_record.zi_timer == 0 || in spa_handle_ignored_writes()
477 handler->zi_record.zi_timer + in spa_handle_ignored_writes()
478 handler->zi_record.zi_duration * hz > in spa_handle_ignored_writes()
482 VERIFY(handler->zi_record.zi_timer == 0 || in spa_handle_ignored_writes()
483 handler->zi_record.zi_timer - in spa_handle_ignored_writes()
484 handler->zi_record.zi_duration >= in spa_handle_ignored_writes()
550 for (inject_handler_t *handler = list_head(&inject_handlers); in zio_handle_io_delay() local
551 handler != NULL; handler = list_next(&inject_handlers, handler)) { in zio_handle_io_delay()
552 if (handler->zi_record.zi_cmd != ZINJECT_DELAY_IO) in zio_handle_io_delay()
555 if (!freq_triggered(handler->zi_record.zi_freq)) in zio_handle_io_delay()
558 if (vd->vdev_guid != handler->zi_record.zi_guid) in zio_handle_io_delay()
565 ASSERT3P(handler->zi_lanes, !=, NULL); in zio_handle_io_delay()
571 ASSERT3U(handler->zi_record.zi_nlanes, !=, 0); in zio_handle_io_delay()
573 ASSERT3U(handler->zi_record.zi_nlanes, >, in zio_handle_io_delay()
574 handler->zi_next_lane); in zio_handle_io_delay()
602 hrtime_t idle = handler->zi_record.zi_timer + gethrtime(); in zio_handle_io_delay()
603 hrtime_t busy = handler->zi_record.zi_timer + in zio_handle_io_delay()
604 handler->zi_lanes[handler->zi_next_lane]; in zio_handle_io_delay()
608 min_handler = handler; in zio_handle_io_delay()
626 min_handler = handler; in zio_handle_io_delay()
720 inject_handler_t *handler; in zio_inject_fault() local
769 handler = kmem_alloc(sizeof (inject_handler_t), KM_SLEEP); in zio_inject_fault()
771 handler->zi_spa = spa; in zio_inject_fault()
772 handler->zi_record = *record; in zio_inject_fault()
774 if (handler->zi_record.zi_cmd == ZINJECT_DELAY_IO) { in zio_inject_fault()
775 handler->zi_lanes = kmem_zalloc( in zio_inject_fault()
776 sizeof (*handler->zi_lanes) * in zio_inject_fault()
777 handler->zi_record.zi_nlanes, KM_SLEEP); in zio_inject_fault()
778 handler->zi_next_lane = 0; in zio_inject_fault()
780 handler->zi_lanes = NULL; in zio_inject_fault()
781 handler->zi_next_lane = 0; in zio_inject_fault()
792 if (handler->zi_record.zi_cmd == ZINJECT_DELAY_IO) { in zio_inject_fault()
798 *id = handler->zi_id = inject_next_id++; in zio_inject_fault()
799 list_insert_tail(&inject_handlers, handler); in zio_inject_fault()
829 inject_handler_t *handler; in zio_inject_list_next() local
835 for (handler = list_head(&inject_handlers); handler != NULL; in zio_inject_list_next()
836 handler = list_next(&inject_handlers, handler)) in zio_inject_list_next()
837 if (handler->zi_id > *id) in zio_inject_list_next()
840 if (handler) { in zio_inject_list_next()
841 *record = handler->zi_record; in zio_inject_list_next()
842 *id = handler->zi_id; in zio_inject_list_next()
843 (void) strncpy(name, spa_name(handler->zi_spa), buflen); in zio_inject_list_next()
862 inject_handler_t *handler; in zio_clear_fault() local
866 for (handler = list_head(&inject_handlers); handler != NULL; in zio_clear_fault()
867 handler = list_next(&inject_handlers, handler)) in zio_clear_fault()
868 if (handler->zi_id == id) in zio_clear_fault()
871 if (handler == NULL) { in zio_clear_fault()
876 if (handler->zi_record.zi_cmd == ZINJECT_DELAY_IO) { in zio_clear_fault()
882 list_remove(&inject_handlers, handler); in zio_clear_fault()
885 if (handler->zi_record.zi_cmd == ZINJECT_DELAY_IO) { in zio_clear_fault()
886 ASSERT3P(handler->zi_lanes, !=, NULL); in zio_clear_fault()
887 kmem_free(handler->zi_lanes, sizeof (*handler->zi_lanes) * in zio_clear_fault()
888 handler->zi_record.zi_nlanes); in zio_clear_fault()
890 ASSERT3P(handler->zi_lanes, ==, NULL); in zio_clear_fault()
893 spa_inject_delref(handler->zi_spa); in zio_clear_fault()
894 kmem_free(handler, sizeof (inject_handler_t)); in zio_clear_fault()