Project

General

Profile

Feature #5551 ยป will_dirty.patch

Alexander Motin, 2015-01-20 02:03 PM

View differences:

dsl_dir.c (revision 277419)
1389 1389
		    accounted_delta, compressed, uncompressed, tx);
1390 1390
		dsl_dir_transfer_space(dd->dd_parent,
1391 1391
		    used - accounted_delta,
1392
		    DD_USED_CHILD_RSRV, DD_USED_CHILD, tx);
1392
		    DD_USED_CHILD_RSRV, DD_USED_CHILD, NULL);
1393 1393
	}
1394 1394
}
1395 1395

  
......
1397 1397
dsl_dir_transfer_space(dsl_dir_t *dd, int64_t delta,
1398 1398
    dd_used_t oldtype, dd_used_t newtype, dmu_tx_t *tx)
1399 1399
{
1400
	ASSERT(dmu_tx_is_syncing(tx));
1400
	ASSERT(tx == NULL || dmu_tx_is_syncing(tx));
1401 1401
	ASSERT(oldtype < DD_USED_NUM);
1402 1402
	ASSERT(newtype < DD_USED_NUM);
1403 1403

  
......
1405 1405
	    !(dsl_dir_phys(dd)->dd_flags & DD_FLAG_USED_BREAKDOWN))
1406 1406
		return;
1407 1407

  
1408
	dmu_buf_will_dirty(dd->dd_dbuf, tx);
1408
	if (tx != NULL)
1409
		dmu_buf_will_dirty(dd->dd_dbuf, tx);
1409 1410
	mutex_enter(&dd->dd_lock);
1410 1411
	ASSERT(delta > 0 ?
1411 1412
	    dsl_dir_phys(dd)->dd_used_breakdown[oldtype] >= delta :
dsl_dataset.c (revision 277419)
136 136
	dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD, delta,
137 137
	    compressed, uncompressed, tx);
138 138
	dsl_dir_transfer_space(ds->ds_dir, used - delta,
139
	    DD_USED_REFRSRV, DD_USED_HEAD, tx);
139
	    DD_USED_REFRSRV, DD_USED_HEAD, NULL);
140 140
}
141 141

  
142 142
int
......
179 179
		dsl_dir_diduse_space(ds->ds_dir, DD_USED_HEAD,
180 180
		    delta, -compressed, -uncompressed, tx);
181 181
		dsl_dir_transfer_space(ds->ds_dir, -used - delta,
182
		    DD_USED_REFRSRV, DD_USED_HEAD, tx);
182
		    DD_USED_REFRSRV, DD_USED_HEAD, NULL);
183 183
	} else {
184 184
		dprintf_bp(bp, "putting on dead list: %s", "");
185 185
		if (async) {
......
2837 2837
		    origin_head->ds_dir->dd_origin_txg, UINT64_MAX,
2838 2838
		    &odl_used, &odl_comp, &odl_uncomp);
2839 2839
		dsl_dir_transfer_space(origin_head->ds_dir, cdl_used - odl_used,
2840
		    DD_USED_HEAD, DD_USED_SNAP, tx);
2840
		    DD_USED_HEAD, DD_USED_SNAP, NULL);
2841 2841
	}
2842 2842

  
2843 2843
	/* swap ds_*_bytes */
    (1-1/1)