* This function is used to change the priority of an existing zio that is * currently in-flight. This is used by the arc to upgrade priority in the * event that a demand read is made for a block that is currently queued * as a scrub or async read IO. Otherwise, the high priority read request * would end up having to wait for the lower priority IO. */
| 3890 | * would end up having to wait for the lower priority IO. |
| 3891 | */ |
| 3892 | void |
| 3893 | zio_change_priority(zio_t *pio, zio_priority_t priority) |
| 3894 | { |
| 3895 | zio_t *cio, *cio_next; |
| 3896 | zio_link_t *zl = NULL; |
| 3897 | |
| 3898 | ASSERT3U(priority, <, ZIO_PRIORITY_NUM_QUEUEABLE); |
| 3899 | |
| 3900 | if (pio->io_vd != NULL && pio->io_vd->vdev_ops->vdev_op_leaf) { |
| 3901 | vdev_queue_change_io_priority(pio, priority); |
| 3902 | } else { |
| 3903 | pio->io_priority = priority; |
| 3904 | } |
| 3905 | |
| 3906 | mutex_enter(&pio->io_lock); |
| 3907 | for (cio = zio_walk_children(pio, &zl); cio != NULL; cio = cio_next) { |
| 3908 | cio_next = zio_walk_children(pio, &zl); |
| 3909 | zio_change_priority(cio, priority); |
| 3910 | } |
| 3911 | mutex_exit(&pio->io_lock); |
| 3912 | } |
| 3913 | |
| 3914 | /* |
| 3915 | * For non-raidz ZIOs, we can just copy aside the bad data read from the |
no test coverage detected