Deleted Added
full compact
vdev_raidz.c (269407) vdev_raidz.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

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

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
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

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

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22/*
23 * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
24 * Copyright (c) 2013 by Delphix. All rights reserved.
24 * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
25 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
26 */
27
28#include <sys/zfs_context.h>
29#include <sys/spa.h>
30#include <sys/vdev_impl.h>
31#ifdef illumos
32#include <sys/vdev_disk.h>

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

1721 * write zio children for those areas to improve aggregation continuity.
1722 * - For read operations:
1723 * 1. Create child zio read operations to each data column's vdev to read
1724 * the range of data required for zio.
1725 * 2. If this is a scrub or resilver operation, or if any of the data
1726 * vdevs have had errors, then create zio read operations to the parity
1727 * columns' VDevs as well.
1728 */
25 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
26 */
27
28#include <sys/zfs_context.h>
29#include <sys/spa.h>
30#include <sys/vdev_impl.h>
31#ifdef illumos
32#include <sys/vdev_disk.h>

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

1721 * write zio children for those areas to improve aggregation continuity.
1722 * - For read operations:
1723 * 1. Create child zio read operations to each data column's vdev to read
1724 * the range of data required for zio.
1725 * 2. If this is a scrub or resilver operation, or if any of the data
1726 * vdevs have had errors, then create zio read operations to the parity
1727 * columns' VDevs as well.
1728 */
1729static int
1729static void
1730vdev_raidz_io_start(zio_t *zio)
1731{
1732 vdev_t *vd = zio->io_vd;
1733 vdev_t *tvd = vd->vdev_top;
1734 vdev_t *cvd;
1735 raidz_map_t *rm;
1736 raidz_col_t *rc;
1737 int c, i;

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

1751 rc = &rm->rm_col[c];
1752 cvd = vd->vdev_child[rc->rc_devidx];
1753 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1754 rc->rc_offset, rc->rc_data, rc->rc_size,
1755 zio->io_type, zio->io_priority, 0,
1756 vdev_raidz_child_done, rc));
1757 }
1758
1730vdev_raidz_io_start(zio_t *zio)
1731{
1732 vdev_t *vd = zio->io_vd;
1733 vdev_t *tvd = vd->vdev_top;
1734 vdev_t *cvd;
1735 raidz_map_t *rm;
1736 raidz_col_t *rc;
1737 int c, i;

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

1751 rc = &rm->rm_col[c];
1752 cvd = vd->vdev_child[rc->rc_devidx];
1753 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1754 rc->rc_offset, rc->rc_data, rc->rc_size,
1755 zio->io_type, zio->io_priority, 0,
1756 vdev_raidz_child_done, rc));
1757 }
1758
1759 zio_interrupt(zio);
1760 return (ZIO_PIPELINE_STOP);
1759 zio_execute(zio);
1760 return;
1761 }
1762
1763 if (zio->io_type == ZIO_TYPE_WRITE) {
1764 vdev_raidz_generate_parity(rm);
1765
1766 for (c = 0; c < rm->rm_cols; c++) {
1767 rc = &rm->rm_col[c];
1768 cvd = vd->vdev_child[rc->rc_devidx];

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

1784 cvd = vd->vdev_child[rc->rc_devidx];
1785 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1786 rc->rc_offset + rc->rc_size, NULL,
1787 1 << tvd->vdev_ashift,
1788 zio->io_type, zio->io_priority,
1789 ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL));
1790 }
1791
1761 }
1762
1763 if (zio->io_type == ZIO_TYPE_WRITE) {
1764 vdev_raidz_generate_parity(rm);
1765
1766 for (c = 0; c < rm->rm_cols; c++) {
1767 rc = &rm->rm_col[c];
1768 cvd = vd->vdev_child[rc->rc_devidx];

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

1784 cvd = vd->vdev_child[rc->rc_devidx];
1785 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1786 rc->rc_offset + rc->rc_size, NULL,
1787 1 << tvd->vdev_ashift,
1788 zio->io_type, zio->io_priority,
1789 ZIO_FLAG_NODATA | ZIO_FLAG_OPTIONAL, NULL, NULL));
1790 }
1791
1792 zio_interrupt(zio);
1793 return (ZIO_PIPELINE_STOP);
1792 zio_execute(zio);
1793 return;
1794 }
1795
1796 ASSERT(zio->io_type == ZIO_TYPE_READ);
1797
1798 /*
1799 * Iterate over the columns in reverse order so that we hit the parity
1800 * last -- any errors along the way will force us to read the parity.
1801 */

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

1825 (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) {
1826 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1827 rc->rc_offset, rc->rc_data, rc->rc_size,
1828 zio->io_type, zio->io_priority, 0,
1829 vdev_raidz_child_done, rc));
1830 }
1831 }
1832
1794 }
1795
1796 ASSERT(zio->io_type == ZIO_TYPE_READ);
1797
1798 /*
1799 * Iterate over the columns in reverse order so that we hit the parity
1800 * last -- any errors along the way will force us to read the parity.
1801 */

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

1825 (zio->io_flags & (ZIO_FLAG_SCRUB | ZIO_FLAG_RESILVER))) {
1826 zio_nowait(zio_vdev_child_io(zio, NULL, cvd,
1827 rc->rc_offset, rc->rc_data, rc->rc_size,
1828 zio->io_type, zio->io_priority, 0,
1829 vdev_raidz_child_done, rc));
1830 }
1831 }
1832
1833 zio_interrupt(zio);
1834 return (ZIO_PIPELINE_STOP);
1833 zio_execute(zio);
1835}
1836
1837
1838/*
1839 * Report a checksum error for a child of a RAID-Z device.
1840 */
1841static void
1842raidz_checksum_error(zio_t *zio, raidz_col_t *rc, void *bad_data)

--- 565 unchanged lines hidden ---
1834}
1835
1836
1837/*
1838 * Report a checksum error for a child of a RAID-Z device.
1839 */
1840static void
1841raidz_checksum_error(zio_t *zio, raidz_col_t *rc, void *bad_data)

--- 565 unchanged lines hidden ---