Deleted Added
full compact
ddt.c (332525) ddt.c (339034)
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

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

1107
1108 bcopy(ddt->ddt_histogram, &ddt->ddt_histogram_cache,
1109 sizeof (ddt->ddt_histogram));
1110}
1111
1112void
1113ddt_sync(spa_t *spa, uint64_t txg)
1114{
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

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

1107
1108 bcopy(ddt->ddt_histogram, &ddt->ddt_histogram_cache,
1109 sizeof (ddt->ddt_histogram));
1110}
1111
1112void
1113ddt_sync(spa_t *spa, uint64_t txg)
1114{
1115 dsl_scan_t *scn = spa->spa_dsl_pool->dp_scan;
1115 dmu_tx_t *tx;
1116 dmu_tx_t *tx;
1116 zio_t *rio = zio_root(spa, NULL, NULL,
1117 ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_SELF_HEAL);
1117 zio_t *rio;
1118
1119 ASSERT(spa_syncing_txg(spa) == txg);
1120
1121 tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg);
1122
1118
1119 ASSERT(spa_syncing_txg(spa) == txg);
1120
1121 tx = dmu_tx_create_assigned(spa->spa_dsl_pool, txg);
1122
1123 rio = zio_root(spa, NULL, NULL,
1124 ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE | ZIO_FLAG_SELF_HEAL);
1125
1126 /*
1127 * This function may cause an immediate scan of ddt blocks (see
1128 * the comment above dsl_scan_ddt() for details). We set the
1129 * scan's root zio here so that we can wait for any scan IOs in
1130 * addition to the regular ddt IOs.
1131 */
1132 ASSERT3P(scn->scn_zio_root, ==, NULL);
1133 scn->scn_zio_root = rio;
1134
1123 for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) {
1124 ddt_t *ddt = spa->spa_ddt[c];
1125 if (ddt == NULL)
1126 continue;
1127 ddt_sync_table(ddt, tx, txg);
1128 ddt_repair_table(ddt, rio);
1129 }
1130
1131 (void) zio_wait(rio);
1135 for (enum zio_checksum c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) {
1136 ddt_t *ddt = spa->spa_ddt[c];
1137 if (ddt == NULL)
1138 continue;
1139 ddt_sync_table(ddt, tx, txg);
1140 ddt_repair_table(ddt, rio);
1141 }
1142
1143 (void) zio_wait(rio);
1144 scn->scn_zio_root = NULL;
1132
1133 dmu_tx_commit(tx);
1134}
1135
1136int
1137ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde)
1138{
1139 do {

--- 25 unchanged lines hidden ---
1145
1146 dmu_tx_commit(tx);
1147}
1148
1149int
1150ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde)
1151{
1152 do {

--- 25 unchanged lines hidden ---