MCPcopy Create free account
hub / github.com/F-Stack/f-stack / zio_change_priority

Function zio_change_priority

freebsd/contrib/openzfs/module/zfs/zio.c:3892–3912  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

3890 * would end up having to wait for the lower priority IO.
3891 */
3892void
3893zio_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

Callers 1

arc_readFunction · 0.85

Calls 4

mutex_enterFunction · 0.85
zio_walk_childrenFunction · 0.85
mutex_exitFunction · 0.85

Tested by

no test coverage detected