1806 mutex_exit(&spa->spa_props_lock);
1807 }
1808
1809 typedef struct spa_load_error {
1810 uint64_t sle_meta_count;
1811 uint64_t sle_data_count;
1812 } spa_load_error_t;
1813
1814 static void
1815 spa_load_verify_done(zio_t *zio)
1816 {
1817 blkptr_t *bp = zio->io_bp;
1818 spa_load_error_t *sle = zio->io_private;
1819 dmu_object_type_t type = BP_GET_TYPE(bp);
1820 int error = zio->io_error;
1821 spa_t *spa = zio->io_spa;
1822
1823 if (error) {
1824 if ((BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)) &&
1825 type != DMU_OT_INTENT_LOG)
1826 atomic_add_64(&sle->sle_meta_count, 1);
1827 else
1828 atomic_add_64(&sle->sle_data_count, 1);
1829 }
1830 zio_data_buf_free(zio->io_data, zio->io_size);
1831
1832 mutex_enter(&spa->spa_scrub_lock);
1833 spa->spa_scrub_inflight--;
1834 cv_broadcast(&spa->spa_scrub_io_cv);
1835 mutex_exit(&spa->spa_scrub_lock);
1836 }
1837
1838 /*
1839 * Maximum number of concurrent scrub i/os to create while verifying
1840 * a pool while importing it.
1841 */
1842 int spa_load_verify_maxinflight = 10000;
1843 boolean_t spa_load_verify_metadata = B_TRUE;
1844 boolean_t spa_load_verify_data = B_TRUE;
1845
1846 /*ARGSUSED*/
1847 static int
1848 spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|
1806 mutex_exit(&spa->spa_props_lock);
1807 }
1808
1809 typedef struct spa_load_error {
1810 uint64_t sle_meta_count;
1811 uint64_t sle_data_count;
1812 } spa_load_error_t;
1813
1814 static void
1815 spa_load_verify_done(zio_t *zio)
1816 {
1817 blkptr_t *bp = zio->io_bp;
1818 spa_load_error_t *sle = zio->io_private;
1819 dmu_object_type_t type = BP_GET_TYPE(bp);
1820 int error = zio->io_error;
1821 spa_t *spa = zio->io_spa;
1822
1823 if (error) {
1824 if ((BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type)) &&
1825 type != DMU_OT_INTENT_LOG)
1826 atomic_inc_64(&sle->sle_meta_count);
1827 else
1828 atomic_inc_64(&sle->sle_data_count);
1829 }
1830 zio_data_buf_free(zio->io_data, zio->io_size);
1831
1832 mutex_enter(&spa->spa_scrub_lock);
1833 spa->spa_scrub_inflight--;
1834 cv_broadcast(&spa->spa_scrub_io_cv);
1835 mutex_exit(&spa->spa_scrub_lock);
1836 }
1837
1838 /*
1839 * Maximum number of concurrent scrub i/os to create while verifying
1840 * a pool while importing it.
1841 */
1842 int spa_load_verify_maxinflight = 10000;
1843 boolean_t spa_load_verify_metadata = B_TRUE;
1844 boolean_t spa_load_verify_data = B_TRUE;
1845
1846 /*ARGSUSED*/
1847 static int
1848 spa_load_verify_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
|