Deleted Added
full compact
vdev_disk.c (269407) vdev_disk.c (274304)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 701 unchanged lines hidden (view full) ---

710{
711 zio_t *zio = zio_arg;
712
713 zio->io_error = error;
714
715 zio_interrupt(zio);
716}
717
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 701 unchanged lines hidden (view full) ---

710{
711 zio_t *zio = zio_arg;
712
713 zio->io_error = error;
714
715 zio_interrupt(zio);
716}
717
718static int
718static void
719vdev_disk_io_start(zio_t *zio)
720{
721 vdev_t *vd = zio->io_vd;
722 vdev_disk_t *dvd = vd->vdev_tsd;
723 vdev_buf_t *vb;
724 struct dk_callback *dkc;
725 buf_t *bp;
726 int error;
727
728 /*
729 * If the vdev is closed, it's likely in the REMOVED or FAULTED state.
730 * Nothing to be done here but return failure.
731 */
732 if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) {
733 zio->io_error = SET_ERROR(ENXIO);
734 zio_interrupt(zio);
719vdev_disk_io_start(zio_t *zio)
720{
721 vdev_t *vd = zio->io_vd;
722 vdev_disk_t *dvd = vd->vdev_tsd;
723 vdev_buf_t *vb;
724 struct dk_callback *dkc;
725 buf_t *bp;
726 int error;
727
728 /*
729 * If the vdev is closed, it's likely in the REMOVED or FAULTED state.
730 * Nothing to be done here but return failure.
731 */
732 if (dvd == NULL || (dvd->vd_ldi_offline && dvd->vd_lh == NULL)) {
733 zio->io_error = SET_ERROR(ENXIO);
734 zio_interrupt(zio);
735 return (ZIO_PIPELINE_STOP);
735 return;
736 }
737
738 if (zio->io_type == ZIO_TYPE_IOCTL) {
739 /* XXPOLICY */
740 if (!vdev_readable(vd)) {
741 zio->io_error = SET_ERROR(ENXIO);
742 zio_interrupt(zio);
736 }
737
738 if (zio->io_type == ZIO_TYPE_IOCTL) {
739 /* XXPOLICY */
740 if (!vdev_readable(vd)) {
741 zio->io_error = SET_ERROR(ENXIO);
742 zio_interrupt(zio);
743 return (ZIO_PIPELINE_STOP);
743 return;
744 }
745
746 switch (zio->io_cmd) {
747
748 case DKIOCFLUSHWRITECACHE:
749
750 if (zfs_nocacheflush)
751 break;

--- 14 unchanged lines hidden (view full) ---

766 (uintptr_t)dkc, FKIOCTL, kcred, NULL);
767
768 if (error == 0) {
769 /*
770 * The ioctl will be done asychronously,
771 * and will call vdev_disk_ioctl_done()
772 * upon completion.
773 */
744 }
745
746 switch (zio->io_cmd) {
747
748 case DKIOCFLUSHWRITECACHE:
749
750 if (zfs_nocacheflush)
751 break;

--- 14 unchanged lines hidden (view full) ---

766 (uintptr_t)dkc, FKIOCTL, kcred, NULL);
767
768 if (error == 0) {
769 /*
770 * The ioctl will be done asychronously,
771 * and will call vdev_disk_ioctl_done()
772 * upon completion.
773 */
774 return (ZIO_PIPELINE_STOP);
774 return;
775 }
776
777 if (error == ENOTSUP || error == ENOTTY) {
778 /*
779 * If we get ENOTSUP or ENOTTY, we know that
780 * no future attempts will ever succeed.
781 * In this case we set a persistent bit so
782 * that we don't bother with the ioctl in the

--- 4 unchanged lines hidden (view full) ---

787 zio->io_error = error;
788
789 break;
790
791 default:
792 zio->io_error = SET_ERROR(ENOTSUP);
793 }
794
775 }
776
777 if (error == ENOTSUP || error == ENOTTY) {
778 /*
779 * If we get ENOTSUP or ENOTTY, we know that
780 * no future attempts will ever succeed.
781 * In this case we set a persistent bit so
782 * that we don't bother with the ioctl in the

--- 4 unchanged lines hidden (view full) ---

787 zio->io_error = error;
788
789 break;
790
791 default:
792 zio->io_error = SET_ERROR(ENOTSUP);
793 }
794
795 zio_interrupt(zio);
796 return (ZIO_PIPELINE_STOP);
795 zio_execute(zio);
796 return;
797 }
798
799 vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP);
800
801 vb->vb_io = zio;
802 bp = &vb->vb_buf;
803
804 bioinit(bp);

--- 4 unchanged lines hidden (view full) ---

809 bp->b_bcount = zio->io_size;
810 bp->b_un.b_addr = zio->io_data;
811 bp->b_lblkno = lbtodb(zio->io_offset);
812 bp->b_bufsize = zio->io_size;
813 bp->b_iodone = (int (*)())vdev_disk_io_intr;
814
815 /* ldi_strategy() will return non-zero only on programming errors */
816 VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0);
797 }
798
799 vb = kmem_alloc(sizeof (vdev_buf_t), KM_SLEEP);
800
801 vb->vb_io = zio;
802 bp = &vb->vb_buf;
803
804 bioinit(bp);

--- 4 unchanged lines hidden (view full) ---

809 bp->b_bcount = zio->io_size;
810 bp->b_un.b_addr = zio->io_data;
811 bp->b_lblkno = lbtodb(zio->io_offset);
812 bp->b_bufsize = zio->io_size;
813 bp->b_iodone = (int (*)())vdev_disk_io_intr;
814
815 /* ldi_strategy() will return non-zero only on programming errors */
816 VERIFY(ldi_strategy(dvd->vd_lh, bp) == 0);
817
818 return (ZIO_PIPELINE_STOP);
819}
820
821static void
822vdev_disk_io_done(zio_t *zio)
823{
824 vdev_t *vd = zio->io_vd;
825
826 /*

--- 117 unchanged lines hidden ---
817}
818
819static void
820vdev_disk_io_done(zio_t *zio)
821{
822 vdev_t *vd = zio->io_vd;
823
824 /*

--- 117 unchanged lines hidden ---