usr/src/uts/common/fs/zfs/dmu_objset.c
changeset 4634 39bfb9e90d34
parent 4603 c7840c367d00
child 4787 602d3f97842c
equal deleted inserted replaced
4633:c10863262ec4 4634:39bfb9e90d34
   777 	int txgoff;
   777 	int txgoff;
   778 	zbookmark_t zb;
   778 	zbookmark_t zb;
   779 	zio_t *zio;
   779 	zio_t *zio;
   780 	list_t *list;
   780 	list_t *list;
   781 	dbuf_dirty_record_t *dr;
   781 	dbuf_dirty_record_t *dr;
   782 	int zio_flags;
       
   783 
   782 
   784 	dprintf_ds(os->os_dsl_dataset, "txg=%llu\n", tx->tx_txg);
   783 	dprintf_ds(os->os_dsl_dataset, "txg=%llu\n", tx->tx_txg);
   785 
   784 
   786 	ASSERT(dmu_tx_is_syncing(tx));
   785 	ASSERT(dmu_tx_is_syncing(tx));
   787 	/* XXX the write_done callback should really give us the tx... */
   786 	/* XXX the write_done callback should really give us the tx... */
   801 	 */
   800 	 */
   802 	zb.zb_objset = os->os_dsl_dataset ? os->os_dsl_dataset->ds_object : 0;
   801 	zb.zb_objset = os->os_dsl_dataset ? os->os_dsl_dataset->ds_object : 0;
   803 	zb.zb_object = 0;
   802 	zb.zb_object = 0;
   804 	zb.zb_level = -1;
   803 	zb.zb_level = -1;
   805 	zb.zb_blkid = 0;
   804 	zb.zb_blkid = 0;
   806 	zio_flags = ZIO_FLAG_MUSTSUCCEED;
       
   807 	if (dmu_ot[DMU_OT_OBJSET].ot_metadata || zb.zb_level != 0)
       
   808 		zio_flags |= ZIO_FLAG_METADATA;
       
   809 	if (BP_IS_OLDER(os->os_rootbp, tx->tx_txg))
   805 	if (BP_IS_OLDER(os->os_rootbp, tx->tx_txg))
   810 		dsl_dataset_block_kill(os->os_dsl_dataset,
   806 		dsl_dataset_block_kill(os->os_dsl_dataset,
   811 		    os->os_rootbp, pio, tx);
   807 		    os->os_rootbp, pio, tx);
   812 	zio = arc_write(pio, os->os_spa, os->os_md_checksum,
   808 	zio = arc_write(pio, os->os_spa, os->os_md_checksum,
   813 	    os->os_md_compress,
   809 	    os->os_md_compress,
   814 	    dmu_get_replication_level(os, &zb, DMU_OT_OBJSET),
   810 	    dmu_get_replication_level(os, &zb, DMU_OT_OBJSET),
   815 	    tx->tx_txg, os->os_rootbp, os->os_phys_buf, ready, killer, os,
   811 	    tx->tx_txg, os->os_rootbp, os->os_phys_buf, ready, killer, os,
   816 	    ZIO_PRIORITY_ASYNC_WRITE, zio_flags, &zb);
   812 	    ZIO_PRIORITY_ASYNC_WRITE, ZIO_FLAG_MUSTSUCCEED | ZIO_FLAG_METADATA,
       
   813 	    &zb);
   817 
   814 
   818 	/*
   815 	/*
   819 	 * Sync meta-dnode - the parent IO for the sync is the root block
   816 	 * Sync meta-dnode - the parent IO for the sync is the root block
   820 	 */
   817 	 */
   821 	os->os_meta_dnode->dn_zio = zio;
   818 	os->os_meta_dnode->dn_zio = zio;