1116 */
1117 if (!BP_IS_HOLE(bp) && zp->zp_nopwrite) {
1118 ASSERT(!zp->zp_dedup);
1119 zio->io_flags |= ZIO_FLAG_NOPWRITE;
1120 return (ZIO_PIPELINE_CONTINUE);
1121 }
1122
1123 ASSERT(!zp->zp_nopwrite);
1124
1125 if (BP_IS_HOLE(bp) || !zp->zp_dedup)
1126 return (ZIO_PIPELINE_CONTINUE);
1127
1128 ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup ||
1129 zp->zp_dedup_verify);
1130
1131 if (BP_GET_CHECKSUM(bp) == zp->zp_checksum) {
1132 BP_SET_DEDUP(bp, 1);
1133 zio->io_pipeline |= ZIO_STAGE_DDT_WRITE;
1134 return (ZIO_PIPELINE_CONTINUE);
1135 }
1136 }
1137
1138 if (!BP_IS_HOLE(bp) && bp->blk_birth == zio->io_txg) {
1139 /*
1140 * We're rewriting an existing block, which means we're
1141 * working on behalf of spa_sync(). For spa_sync() to
1142 * converge, it must eventually be the case that we don't
1143 * have to allocate new blocks. But compression changes
1144 * the blocksize, which forces a reallocate, and makes
1145 * convergence take longer. Therefore, after the first
1146 * few passes, stop compressing to ensure convergence.
1147 */
1148 pass = spa_sync_pass(spa);
1149
1150 ASSERT(zio->io_txg == spa_syncing_txg(spa));
1151 ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL);
1152 ASSERT(!BP_GET_DEDUP(bp));
1153
1154 if (pass >= zfs_sync_pass_dont_compress)
1155 compress = ZIO_COMPRESS_OFF;
|
1116 */
1117 if (!BP_IS_HOLE(bp) && zp->zp_nopwrite) {
1118 ASSERT(!zp->zp_dedup);
1119 zio->io_flags |= ZIO_FLAG_NOPWRITE;
1120 return (ZIO_PIPELINE_CONTINUE);
1121 }
1122
1123 ASSERT(!zp->zp_nopwrite);
1124
1125 if (BP_IS_HOLE(bp) || !zp->zp_dedup)
1126 return (ZIO_PIPELINE_CONTINUE);
1127
1128 ASSERT(zio_checksum_table[zp->zp_checksum].ci_dedup ||
1129 zp->zp_dedup_verify);
1130
1131 if (BP_GET_CHECKSUM(bp) == zp->zp_checksum) {
1132 BP_SET_DEDUP(bp, 1);
1133 zio->io_pipeline |= ZIO_STAGE_DDT_WRITE;
1134 return (ZIO_PIPELINE_CONTINUE);
1135 }
1136 zio->io_bp_override = NULL;
1137 BP_ZERO(bp);
1138 }
1139
1140 if (!BP_IS_HOLE(bp) && bp->blk_birth == zio->io_txg) {
1141 /*
1142 * We're rewriting an existing block, which means we're
1143 * working on behalf of spa_sync(). For spa_sync() to
1144 * converge, it must eventually be the case that we don't
1145 * have to allocate new blocks. But compression changes
1146 * the blocksize, which forces a reallocate, and makes
1147 * convergence take longer. Therefore, after the first
1148 * few passes, stop compressing to ensure convergence.
1149 */
1150 pass = spa_sync_pass(spa);
1151
1152 ASSERT(zio->io_txg == spa_syncing_txg(spa));
1153 ASSERT(zio->io_child_type == ZIO_CHILD_LOGICAL);
1154 ASSERT(!BP_GET_DEDUP(bp));
1155
1156 if (pass >= zfs_sync_pass_dont_compress)
1157 compress = ZIO_COMPRESS_OFF;
|