| 3835 | } |
| 3836 | |
| 3837 | static zio_t * |
| 3838 | zio_vdev_io_done(zio_t *zio) |
| 3839 | { |
| 3840 | vdev_t *vd = zio->io_vd; |
| 3841 | vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; |
| 3842 | boolean_t unexpected_error = B_FALSE; |
| 3843 | |
| 3844 | if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { |
| 3845 | return (NULL); |
| 3846 | } |
| 3847 | |
| 3848 | ASSERT(zio->io_type == ZIO_TYPE_READ || |
| 3849 | zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_TRIM); |
| 3850 | |
| 3851 | if (zio->io_delay) |
| 3852 | zio->io_delay = gethrtime() - zio->io_delay; |
| 3853 | |
| 3854 | if (vd != NULL && vd->vdev_ops->vdev_op_leaf && |
| 3855 | vd->vdev_ops != &vdev_draid_spare_ops) { |
| 3856 | vdev_queue_io_done(zio); |
| 3857 | |
| 3858 | if (zio->io_type == ZIO_TYPE_WRITE) |
| 3859 | vdev_cache_write(zio); |
| 3860 | |
| 3861 | if (zio_injection_enabled && zio->io_error == 0) |
| 3862 | zio->io_error = zio_handle_device_injections(vd, zio, |
| 3863 | EIO, EILSEQ); |
| 3864 | |
| 3865 | if (zio_injection_enabled && zio->io_error == 0) |
| 3866 | zio->io_error = zio_handle_label_injection(zio, EIO); |
| 3867 | |
| 3868 | if (zio->io_error && zio->io_type != ZIO_TYPE_TRIM) { |
| 3869 | if (!vdev_accessible(vd, zio)) { |
| 3870 | zio->io_error = SET_ERROR(ENXIO); |
| 3871 | } else { |
| 3872 | unexpected_error = B_TRUE; |
| 3873 | } |
| 3874 | } |
| 3875 | } |
| 3876 | |
| 3877 | ops->vdev_op_io_done(zio); |
| 3878 | |
| 3879 | if (unexpected_error) |
| 3880 | VERIFY(vdev_probe(vd, zio) == NULL); |
| 3881 | |
| 3882 | return (zio); |
| 3883 | } |
| 3884 | |
| 3885 | /* |
| 3886 | * This function is used to change the priority of an existing zio that is |
nothing calls this directly
no test coverage detected