dbuf.c (242845) | dbuf.c (243524) |
---|---|
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 --- 754 unchanged lines hidden (view full) --- 763 764 if (db->db_blkid == DMU_BONUS_BLKID || 765 dr->dt.dl.dr_override_state == DR_NOT_OVERRIDDEN) 766 return; 767 768 ASSERT(db->db_data_pending != dr); 769 770 /* free this block */ | 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 --- 754 unchanged lines hidden (view full) --- 763 764 if (db->db_blkid == DMU_BONUS_BLKID || 765 dr->dt.dl.dr_override_state == DR_NOT_OVERRIDDEN) 766 return; 767 768 ASSERT(db->db_data_pending != dr); 769 770 /* free this block */ |
771 if (!BP_IS_HOLE(bp)) { | 771 if (!BP_IS_HOLE(bp) && !dr->dt.dl.dr_nopwrite) { |
772 spa_t *spa; 773 774 DB_GET_SPA(&spa, db); 775 zio_free(spa, txg, bp); 776 } 777 dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; | 772 spa_t *spa; 773 774 DB_GET_SPA(&spa, db); 775 zio_free(spa, txg, bp); 776 } 777 dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; |
778 dr->dt.dl.dr_nopwrite = B_FALSE; 779 |
|
778 /* 779 * Release the already-written buffer, so we leave it in 780 * a consistent dirty state. Note that all callers are 781 * modifying the buffer, so they will immediately do 782 * another (redundant) arc_release(). Therefore, leave 783 * the buf thawed to save the effort of freezing & 784 * immediately re-thawing it. 785 */ --- 1398 unchanged lines hidden (view full) --- 2184 2185 if (db->db_blkptr) 2186 res = dsl_dataset_block_freeable(db->db_objset->os_dsl_dataset, 2187 db->db_blkptr, db->db_blkptr->blk_birth); 2188 2189 return (res); 2190} 2191 | 780 /* 781 * Release the already-written buffer, so we leave it in 782 * a consistent dirty state. Note that all callers are 783 * modifying the buffer, so they will immediately do 784 * another (redundant) arc_release(). Therefore, leave 785 * the buf thawed to save the effort of freezing & 786 * immediately re-thawing it. 787 */ --- 1398 unchanged lines hidden (view full) --- 2186 2187 if (db->db_blkptr) 2188 res = dsl_dataset_block_freeable(db->db_objset->os_dsl_dataset, 2189 db->db_blkptr, db->db_blkptr->blk_birth); 2190 2191 return (res); 2192} 2193 |
2194blkptr_t * 2195dmu_buf_get_blkptr(dmu_buf_t *db) 2196{ 2197 dmu_buf_impl_t *dbi = (dmu_buf_impl_t *)db; 2198 return (dbi->db_blkptr); 2199} 2200 |
|
2192static void 2193dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) 2194{ 2195 /* ASSERT(dmu_tx_is_syncing(tx) */ 2196 ASSERT(MUTEX_HELD(&db->db_mtx)); 2197 2198 if (db->db_blkptr != NULL) 2199 return; --- 326 unchanged lines hidden (view full) --- 2526 blkptr_t *bp = zio->io_bp; 2527 blkptr_t *bp_orig = &zio->io_bp_orig; 2528 uint64_t txg = zio->io_txg; 2529 dbuf_dirty_record_t **drp, *dr; 2530 2531 ASSERT0(zio->io_error); 2532 ASSERT(db->db_blkptr == bp); 2533 | 2201static void 2202dbuf_check_blkptr(dnode_t *dn, dmu_buf_impl_t *db) 2203{ 2204 /* ASSERT(dmu_tx_is_syncing(tx) */ 2205 ASSERT(MUTEX_HELD(&db->db_mtx)); 2206 2207 if (db->db_blkptr != NULL) 2208 return; --- 326 unchanged lines hidden (view full) --- 2535 blkptr_t *bp = zio->io_bp; 2536 blkptr_t *bp_orig = &zio->io_bp_orig; 2537 uint64_t txg = zio->io_txg; 2538 dbuf_dirty_record_t **drp, *dr; 2539 2540 ASSERT0(zio->io_error); 2541 ASSERT(db->db_blkptr == bp); 2542 |
2534 if (zio->io_flags & ZIO_FLAG_IO_REWRITE) { | 2543 /* 2544 * For nopwrites and rewrites we ensure that the bp matches our 2545 * original and bypass all the accounting. 2546 */ 2547 if (zio->io_flags & (ZIO_FLAG_IO_REWRITE | ZIO_FLAG_NOPWRITE)) { |
2535 ASSERT(BP_EQUAL(bp, bp_orig)); 2536 } else { 2537 objset_t *os; 2538 dsl_dataset_t *ds; 2539 dmu_tx_t *tx; 2540 2541 DB_GET_OBJSET(&os, db); 2542 ds = os->os_dsl_dataset; --- 174 unchanged lines hidden (view full) --- 2717 ASSERT(db->db_state != DB_NOFILL); 2718 dr->dr_zio = zio_write(zio, os->os_spa, txg, 2719 db->db_blkptr, data->b_data, arc_buf_size(data), &zp, 2720 dbuf_write_override_ready, dbuf_write_override_done, dr, 2721 ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); 2722 mutex_enter(&db->db_mtx); 2723 dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; 2724 zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, | 2548 ASSERT(BP_EQUAL(bp, bp_orig)); 2549 } else { 2550 objset_t *os; 2551 dsl_dataset_t *ds; 2552 dmu_tx_t *tx; 2553 2554 DB_GET_OBJSET(&os, db); 2555 ds = os->os_dsl_dataset; --- 174 unchanged lines hidden (view full) --- 2730 ASSERT(db->db_state != DB_NOFILL); 2731 dr->dr_zio = zio_write(zio, os->os_spa, txg, 2732 db->db_blkptr, data->b_data, arc_buf_size(data), &zp, 2733 dbuf_write_override_ready, dbuf_write_override_done, dr, 2734 ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); 2735 mutex_enter(&db->db_mtx); 2736 dr->dt.dl.dr_override_state = DR_NOT_OVERRIDDEN; 2737 zio_write_override(dr->dr_zio, &dr->dt.dl.dr_overridden_by, |
2725 dr->dt.dl.dr_copies); | 2738 dr->dt.dl.dr_copies, dr->dt.dl.dr_nopwrite); |
2726 mutex_exit(&db->db_mtx); 2727 } else if (db->db_state == DB_NOFILL) { 2728 ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); 2729 dr->dr_zio = zio_write(zio, os->os_spa, txg, 2730 db->db_blkptr, NULL, db->db.db_size, &zp, 2731 dbuf_write_nofill_ready, dbuf_write_nofill_done, db, 2732 ZIO_PRIORITY_ASYNC_WRITE, 2733 ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); 2734 } else { 2735 ASSERT(arc_released(data)); 2736 dr->dr_zio = arc_write(zio, os->os_spa, txg, 2737 db->db_blkptr, data, DBUF_IS_L2CACHEABLE(db), &zp, 2738 dbuf_write_ready, dbuf_write_done, db, 2739 ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); 2740 } 2741} | 2739 mutex_exit(&db->db_mtx); 2740 } else if (db->db_state == DB_NOFILL) { 2741 ASSERT(zp.zp_checksum == ZIO_CHECKSUM_OFF); 2742 dr->dr_zio = zio_write(zio, os->os_spa, txg, 2743 db->db_blkptr, NULL, db->db.db_size, &zp, 2744 dbuf_write_nofill_ready, dbuf_write_nofill_done, db, 2745 ZIO_PRIORITY_ASYNC_WRITE, 2746 ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_NODATA, &zb); 2747 } else { 2748 ASSERT(arc_released(data)); 2749 dr->dr_zio = arc_write(zio, os->os_spa, txg, 2750 db->db_blkptr, data, DBUF_IS_L2CACHEABLE(db), &zp, 2751 dbuf_write_ready, dbuf_write_done, db, 2752 ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED, &zb); 2753 } 2754} |