Deleted Added
sdiff udiff text old ( 259813 ) new ( 268075 )
full compact
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

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

187 bpo->bpo_dbuf = NULL;
188 bpo->bpo_phys = NULL;
189 bpo->bpo_cached_dbuf = NULL;
190 bpo->bpo_object = 0;
191
192 mutex_destroy(&bpo->bpo_lock);
193}
194
195static int
196bpobj_iterate_impl(bpobj_t *bpo, bpobj_itor_t func, void *arg, dmu_tx_t *tx,
197 boolean_t free)
198{
199 dmu_object_info_t doi;
200 int epb;
201 int64_t i;
202 int err = 0;

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

327 if (free) {
328 VERIFY3U(0, ==, dmu_free_range(bpo->bpo_os,
329 bpo->bpo_phys->bpo_subobjs,
330 (i + 1) * sizeof (uint64_t), -1ULL, tx));
331 }
332
333out:
334 /* If there are no entries, there should be no bytes. */
335 ASSERT(bpo->bpo_phys->bpo_num_blkptrs > 0 ||
336 (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_num_subobjs > 0) ||
337 bpo->bpo_phys->bpo_bytes == 0);
338
339 mutex_exit(&bpo->bpo_lock);
340 return (err);
341}
342
343/*
344 * Iterate and remove the entries. If func returns nonzero, iteration
345 * will stop and that entry will not be removed.

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

372 if (subobj == dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj) {
373 bpobj_decr_empty(bpo->bpo_os, tx);
374 return;
375 }
376
377 VERIFY3U(0, ==, bpobj_open(&subbpo, bpo->bpo_os, subobj));
378 VERIFY3U(0, ==, bpobj_space(&subbpo, &used, &comp, &uncomp));
379
380 if (used == 0) {
381 /* No point in having an empty subobj. */
382 bpobj_close(&subbpo);
383 bpobj_free(bpo->bpo_os, subobj, tx);
384 return;
385 }
386
387 dmu_buf_will_dirty(bpo->bpo_dbuf, tx);
388 if (bpo->bpo_phys->bpo_subobjs == 0) {

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

448 blkptr_t stored_bp = *bp;
449 uint64_t offset;
450 int blkoff;
451 blkptr_t *bparray;
452
453 ASSERT(!BP_IS_HOLE(bp));
454 ASSERT(bpo->bpo_object != dmu_objset_pool(bpo->bpo_os)->dp_empty_bpobj);
455
456 /* We never need the fill count. */
457 stored_bp.blk_fill = 0;
458
459 /* The bpobj will compress better if we can leave off the checksum */
460 if (!BP_GET_DEDUP(bp))
461 bzero(&stored_bp.blk_cksum, sizeof (stored_bp.blk_cksum));
462
463 mutex_enter(&bpo->bpo_lock);
464
465 offset = bpo->bpo_phys->bpo_num_blkptrs * sizeof (stored_bp);
466 blkoff = P2PHASE(bpo->bpo_phys->bpo_num_blkptrs, bpo->bpo_epb);
467
468 if (bpo->bpo_cached_dbuf == NULL ||
469 offset < bpo->bpo_cached_dbuf->db_offset ||
470 offset >= bpo->bpo_cached_dbuf->db_offset +

--- 94 unchanged lines hidden ---