• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /freebsd-12-stable/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/

Lines Matching refs:zio

34 #include <sys/zio.h>
376 sizeof (zio_t), offsetof(struct zio, io_queue_node));
379 offsetof(struct zio, io_offset_node));
382 offsetof(struct zio, io_offset_node));
398 sizeof (zio_t), offsetof(struct zio, io_queue_node));
419 vdev_queue_io_add(vdev_queue_t *vq, zio_t *zio)
421 spa_t *spa = zio->io_spa;
425 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
426 avl_add(vdev_queue_class_tree(vq, zio->io_priority), zio);
427 qtt = vdev_queue_type_tree(vq, zio->io_type);
429 avl_add(qtt, zio);
433 spa->spa_queue_stats[zio->io_priority].spa_queued++;
441 vdev_queue_io_remove(vdev_queue_t *vq, zio_t *zio)
443 spa_t *spa = zio->io_spa;
447 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
448 avl_remove(vdev_queue_class_tree(vq, zio->io_priority), zio);
449 qtt = vdev_queue_type_tree(vq, zio->io_type);
451 avl_remove(qtt, zio);
455 ASSERT3U(spa->spa_queue_stats[zio->io_priority].spa_queued, >, 0);
456 spa->spa_queue_stats[zio->io_priority].spa_queued--;
464 vdev_queue_pending_add(vdev_queue_t *vq, zio_t *zio)
466 spa_t *spa = zio->io_spa;
468 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
469 vq->vq_class[zio->io_priority].vqc_active++;
470 avl_add(&vq->vq_active_tree, zio);
474 spa->spa_queue_stats[zio->io_priority].spa_active++;
482 vdev_queue_pending_remove(vdev_queue_t *vq, zio_t *zio)
484 spa_t *spa = zio->io_spa;
486 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
487 vq->vq_class[zio->io_priority].vqc_active--;
488 avl_remove(&vq->vq_active_tree, zio);
492 ASSERT3U(spa->spa_queue_stats[zio->io_priority].spa_active, >, 0);
493 spa->spa_queue_stats[zio->io_priority].spa_active--;
498 if (zio->io_type == ZIO_TYPE_READ) {
500 ksio->nread += zio->io_size;
501 } else if (zio->io_type == ZIO_TYPE_WRITE) {
503 ksio->nwritten += zio->io_size;
664 vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
685 if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE || limit == 0)
688 first = last = zio;
690 if (zio->io_type == ZIO_TYPE_READ)
712 flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT;
713 t = vdev_queue_type_tree(vq, zio->io_type);
718 dio->io_type == zio->io_type) {
744 dio->io_type == zio->io_type) {
761 if (zio->io_type == ZIO_TYPE_WRITE && mandatory != NULL) {
800 zio->io_priority, flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE,
842 zio_t *zio, *aio;
868 zio = avl_nearest(tree, idx, AVL_AFTER);
869 if (zio == NULL)
870 zio = avl_first(tree);
871 ASSERT3U(zio->io_priority, ==, p);
873 aio = vdev_queue_aggregate(vq, zio);
875 zio = aio;
877 vdev_queue_io_remove(vq, zio);
885 if (zio->io_flags & ZIO_FLAG_NODATA) {
887 zio_vdev_io_bypass(zio);
888 zio_execute(zio);
893 vdev_queue_pending_add(vq, zio);
894 vq->vq_last_offset = zio->io_offset;
896 return (zio);
900 vdev_queue_io(zio_t *zio)
902 vdev_queue_t *vq = &zio->io_vd->vdev_queue;
905 if (zio->io_flags & ZIO_FLAG_DONT_QUEUE)
906 return (zio);
912 if (zio->io_type == ZIO_TYPE_READ) {
913 if (zio->io_priority != ZIO_PRIORITY_SYNC_READ &&
914 zio->io_priority != ZIO_PRIORITY_ASYNC_READ &&
915 zio->io_priority != ZIO_PRIORITY_SCRUB &&
916 zio->io_priority != ZIO_PRIORITY_REMOVAL &&
917 zio->io_priority != ZIO_PRIORITY_INITIALIZING)
918 zio->io_priority = ZIO_PRIORITY_ASYNC_READ;
919 } else if (zio->io_type == ZIO_TYPE_WRITE) {
920 if (zio->io_priority != ZIO_PRIORITY_SYNC_WRITE &&
921 zio->io_priority != ZIO_PRIORITY_ASYNC_WRITE &&
922 zio->io_priority != ZIO_PRIORITY_REMOVAL &&
923 zio->io_priority != ZIO_PRIORITY_INITIALIZING)
924 zio->io_priority = ZIO_PRIORITY_ASYNC_WRITE;
926 ASSERT(zio->io_type == ZIO_TYPE_FREE);
927 zio->io_priority = ZIO_PRIORITY_TRIM;
930 zio->io_flags |= ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE;
933 zio->io_timestamp = gethrtime();
934 vdev_queue_io_add(vq, zio);
950 vdev_queue_io_done(zio_t *zio)
952 vdev_queue_t *vq = &zio->io_vd->vdev_queue;
957 vdev_queue_pending_remove(vq, zio);
976 vdev_queue_change_io_priority(zio_t *zio, zio_priority_t priority)
978 vdev_queue_t *vq = &zio->io_vd->vdev_queue;
982 * ZIO_PRIORITY_NOW is used by the vdev cache code and the aggregate zio
984 * case, the zio is already going to be issued as quickly as possible
987 if (zio->io_priority == ZIO_PRIORITY_NOW)
990 ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
993 if (zio->io_type == ZIO_TYPE_READ) {
999 ASSERT(zio->io_type == ZIO_TYPE_WRITE);
1008 * If the zio is in none of the queues we can simply change
1009 * the priority. If the zio is waiting to be submitted we must
1011 * Otherwise, the zio is currently active and we cannot change its
1014 tree = vdev_queue_class_tree(vq, zio->io_priority);
1015 if (avl_find(tree, zio, NULL) == zio) {
1016 avl_remove(vdev_queue_class_tree(vq, zio->io_priority), zio);
1017 zio->io_priority = priority;
1018 avl_add(vdev_queue_class_tree(vq, zio->io_priority), zio);
1019 } else if (avl_find(&vq->vq_active_tree, zio, NULL) != zio) {
1020 zio->io_priority = priority;
1044 vdev_queue_register_lastoffset(vdev_t *vd, zio_t *zio)
1046 vd->vdev_queue.vq_lastoffset = zio->io_offset + zio->io_size;