Lines Matching defs:zio

34 #include <sys/zio.h>
251 sizeof (zio_t), offsetof(struct zio, io_queue_node));
254 offsetof(struct zio, io_offset_node));
257 offsetof(struct zio, io_offset_node));
273 sizeof (zio_t), offsetof(struct zio, io_queue_node));
292 vdev_queue_io_add(vdev_queue_t *vq, zio_t *zio)
294 spa_t *spa = zio->io_spa;
296 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
297 avl_add(vdev_queue_class_tree(vq, zio->io_priority), zio);
298 avl_add(vdev_queue_type_tree(vq, zio->io_type), zio);
301 spa->spa_queue_stats[zio->io_priority].spa_queued++;
308 vdev_queue_io_remove(vdev_queue_t *vq, zio_t *zio)
310 spa_t *spa = zio->io_spa;
312 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
313 avl_remove(vdev_queue_class_tree(vq, zio->io_priority), zio);
314 avl_remove(vdev_queue_type_tree(vq, zio->io_type), zio);
317 ASSERT3U(spa->spa_queue_stats[zio->io_priority].spa_queued, >, 0);
318 spa->spa_queue_stats[zio->io_priority].spa_queued--;
325 vdev_queue_pending_add(vdev_queue_t *vq, zio_t *zio)
327 spa_t *spa = zio->io_spa;
329 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
330 vq->vq_class[zio->io_priority].vqc_active++;
331 avl_add(&vq->vq_active_tree, zio);
334 spa->spa_queue_stats[zio->io_priority].spa_active++;
341 vdev_queue_pending_remove(vdev_queue_t *vq, zio_t *zio)
343 spa_t *spa = zio->io_spa;
345 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
346 vq->vq_class[zio->io_priority].vqc_active--;
347 avl_remove(&vq->vq_active_tree, zio);
350 ASSERT3U(spa->spa_queue_stats[zio->io_priority].spa_active, >, 0);
351 spa->spa_queue_stats[zio->io_priority].spa_active--;
356 if (zio->io_type == ZIO_TYPE_READ) {
358 ksio->nread += zio->io_size;
359 } else if (zio->io_type == ZIO_TYPE_WRITE) {
361 ksio->nwritten += zio->io_size;
507 vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
513 avl_tree_t *t = vdev_queue_type_tree(vq, zio->io_type);
514 enum zio_flag flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT;
516 if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE)
519 first = last = zio;
521 if (zio->io_type == ZIO_TYPE_READ)
582 if (zio->io_type == ZIO_TYPE_WRITE && mandatory != NULL) {
614 zio_buf_alloc(size), size, first->io_type, zio->io_priority,
647 zio_t *zio, *aio;
673 zio = avl_nearest(tree, idx, AVL_AFTER);
674 if (zio == NULL)
675 zio = avl_first(tree);
676 ASSERT3U(zio->io_priority, ==, p);
678 aio = vdev_queue_aggregate(vq, zio);
680 zio = aio;
682 vdev_queue_io_remove(vq, zio);
690 if (zio->io_flags & ZIO_FLAG_NODATA) {
692 zio_vdev_io_bypass(zio);
693 zio_execute(zio);
698 vdev_queue_pending_add(vq, zio);
699 vq->vq_last_offset = zio->io_offset;
701 return (zio);
705 vdev_queue_io(zio_t *zio)
707 vdev_queue_t *vq = &zio->io_vd->vdev_queue;
710 if (zio->io_flags & ZIO_FLAG_DONT_QUEUE)
711 return (zio);
717 if (zio->io_type == ZIO_TYPE_READ) {
718 if (zio->io_priority != ZIO_PRIORITY_SYNC_READ &&
719 zio->io_priority != ZIO_PRIORITY_ASYNC_READ &&
720 zio->io_priority != ZIO_PRIORITY_SCRUB)
721 zio->io_priority = ZIO_PRIORITY_ASYNC_READ;
723 ASSERT(zio->io_type == ZIO_TYPE_WRITE);
724 if (zio->io_priority != ZIO_PRIORITY_SYNC_WRITE &&
725 zio->io_priority != ZIO_PRIORITY_ASYNC_WRITE)
726 zio->io_priority = ZIO_PRIORITY_ASYNC_WRITE;
729 zio->io_flags |= ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE;
732 zio->io_timestamp = gethrtime();
733 vdev_queue_io_add(vq, zio);
749 vdev_queue_io_done(zio_t *zio)
751 vdev_queue_t *vq = &zio->io_vd->vdev_queue;
756 vdev_queue_pending_remove(vq, zio);