Deleted Added
full compact
194a195,201
> static boolean_t
> bpobj_hasentries(bpobj_t *bpo)
> {
> return (bpo->bpo_phys->bpo_num_blkptrs != 0 ||
> (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_num_subobjs != 0));
> }
>
335,337c342,346
< ASSERT(bpo->bpo_phys->bpo_num_blkptrs > 0 ||
< (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_num_subobjs > 0) ||
< bpo->bpo_phys->bpo_bytes == 0);
---
> if (!bpobj_hasentries(bpo)) {
> ASSERT0(bpo->bpo_phys->bpo_bytes);
> ASSERT0(bpo->bpo_phys->bpo_comp);
> ASSERT0(bpo->bpo_phys->bpo_uncomp);
> }
380c389
< if (used == 0) {
---
> if (!bpobj_hasentries(&subbpo)) {
455a465,484
> if (BP_IS_EMBEDDED(bp)) {
> /*
> * The bpobj will compress better without the payload.
> *
> * Note that we store EMBEDDED bp's because they have an
> * uncompressed size, which must be accounted for. An
> * alternative would be to add their size to bpo_uncomp
> * without storing the bp, but that would create additional
> * complications: bpo_uncomp would be inconsistent with the
> * set of BP's stored, and bpobj_iterate() wouldn't visit
> * all the space accounted for in the bpobj.
> */
> bzero(&stored_bp, sizeof (stored_bp));
> stored_bp.blk_prop = bp->blk_prop;
> stored_bp.blk_birth = bp->blk_birth;
> } else if (!BP_GET_DEDUP(bp)) {
> /* The bpobj will compress better without the checksum */
> bzero(&stored_bp.blk_cksum, sizeof (stored_bp.blk_cksum));
> }
>
459,462d487
< /* The bpobj will compress better if we can leave off the checksum */
< if (!BP_GET_DEDUP(bp))
< bzero(&stored_bp.blk_cksum, sizeof (stored_bp.blk_cksum));
<