* The bp created via this function may be used for repairs and scrub, but it * will be missing the salt / IV required to do a full decrypting read. */
| 273 | * will be missing the salt / IV required to do a full decrypting read. |
| 274 | */ |
| 275 | void |
| 276 | ddt_bp_create(enum zio_checksum checksum, |
| 277 | const ddt_key_t *ddk, const ddt_phys_t *ddp, blkptr_t *bp) |
| 278 | { |
| 279 | BP_ZERO(bp); |
| 280 | |
| 281 | if (ddp != NULL) |
| 282 | ddt_bp_fill(ddp, bp, ddp->ddp_phys_birth); |
| 283 | |
| 284 | bp->blk_cksum = ddk->ddk_cksum; |
| 285 | |
| 286 | BP_SET_LSIZE(bp, DDK_GET_LSIZE(ddk)); |
| 287 | BP_SET_PSIZE(bp, DDK_GET_PSIZE(ddk)); |
| 288 | BP_SET_COMPRESS(bp, DDK_GET_COMPRESS(ddk)); |
| 289 | BP_SET_CRYPT(bp, DDK_GET_CRYPT(ddk)); |
| 290 | BP_SET_FILL(bp, 1); |
| 291 | BP_SET_CHECKSUM(bp, checksum); |
| 292 | BP_SET_TYPE(bp, DMU_OT_DEDUP); |
| 293 | BP_SET_LEVEL(bp, 0); |
| 294 | BP_SET_DEDUP(bp, 1); |
| 295 | BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER); |
| 296 | } |
| 297 | |
| 298 | void |
| 299 | ddt_key_fill(ddt_key_t *ddk, const blkptr_t *bp) |
no test coverage detected