dsl_dataset.c (239620) | dsl_dataset.c (239774) |
---|---|
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 --- 1244 unchanged lines hidden (view full) --- 1253 dp = ds->ds_dir->dd_pool; 1254 1255 if (txg_list_add(&dp->dp_dirty_datasets, ds, tx->tx_txg) == 0) { 1256 /* up the hold count until we can be written out */ 1257 dmu_buf_add_ref(ds->ds_dbuf, ds); 1258 } 1259} 1260 | 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 --- 1244 unchanged lines hidden (view full) --- 1253 dp = ds->ds_dir->dd_pool; 1254 1255 if (txg_list_add(&dp->dp_dirty_datasets, ds, tx->tx_txg) == 0) { 1256 /* up the hold count until we can be written out */ 1257 dmu_buf_add_ref(ds->ds_dbuf, ds); 1258 } 1259} 1260 |
1261boolean_t 1262dsl_dataset_is_dirty(dsl_dataset_t *ds) 1263{ 1264 for (int t = 0; t < TXG_SIZE; t++) { 1265 if (txg_list_member(&ds->ds_dir->dd_pool->dp_dirty_datasets, 1266 ds, t)) 1267 return (B_TRUE); 1268 } 1269 return (B_FALSE); 1270} 1271 |
|
1261/* 1262 * The unique space in the head dataset can be calculated by subtracting 1263 * the space used in the most recent snapshot, that is still being used 1264 * in this file system, from the space currently in use. To figure out 1265 * the space in the most recent snapshot still in use, we need to take 1266 * the total space used in the snapshot and subtract out the space that 1267 * has been freed up since the snapshot was taken. 1268 */ --- 2221 unchanged lines hidden (view full) --- 3490 uint64_t effective_value = psa->psa_effective_value; 3491 3492 dsl_prop_set_sync(ds, psa, tx); 3493 DSL_PROP_CHECK_PREDICTION(ds->ds_dir, psa); 3494 3495 if (ds->ds_quota != effective_value) { 3496 dmu_buf_will_dirty(ds->ds_dbuf, tx); 3497 ds->ds_quota = effective_value; | 1272/* 1273 * The unique space in the head dataset can be calculated by subtracting 1274 * the space used in the most recent snapshot, that is still being used 1275 * in this file system, from the space currently in use. To figure out 1276 * the space in the most recent snapshot still in use, we need to take 1277 * the total space used in the snapshot and subtract out the space that 1278 * has been freed up since the snapshot was taken. 1279 */ --- 2221 unchanged lines hidden (view full) --- 3501 uint64_t effective_value = psa->psa_effective_value; 3502 3503 dsl_prop_set_sync(ds, psa, tx); 3504 DSL_PROP_CHECK_PREDICTION(ds->ds_dir, psa); 3505 3506 if (ds->ds_quota != effective_value) { 3507 dmu_buf_will_dirty(ds->ds_dbuf, tx); 3508 ds->ds_quota = effective_value; |
3498 3499 spa_history_log_internal(LOG_DS_REFQUOTA, 3500 ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu ", 3501 (longlong_t)ds->ds_quota, ds->ds_object); | |
3502 } 3503} 3504 3505int 3506dsl_dataset_set_quota(const char *dsname, zprop_source_t source, uint64_t quota) 3507{ 3508 dsl_dataset_t *ds; 3509 dsl_prop_setarg_t psa; --- 87 unchanged lines hidden (view full) --- 3597 unique = ds->ds_phys->ds_unique_bytes; 3598 delta = MAX(0, (int64_t)(effective_value - unique)) - 3599 MAX(0, (int64_t)(ds->ds_reserved - unique)); 3600 ds->ds_reserved = effective_value; 3601 mutex_exit(&ds->ds_lock); 3602 3603 dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); 3604 mutex_exit(&ds->ds_dir->dd_lock); | 3509 } 3510} 3511 3512int 3513dsl_dataset_set_quota(const char *dsname, zprop_source_t source, uint64_t quota) 3514{ 3515 dsl_dataset_t *ds; 3516 dsl_prop_setarg_t psa; --- 87 unchanged lines hidden (view full) --- 3604 unique = ds->ds_phys->ds_unique_bytes; 3605 delta = MAX(0, (int64_t)(effective_value - unique)) - 3606 MAX(0, (int64_t)(ds->ds_reserved - unique)); 3607 ds->ds_reserved = effective_value; 3608 mutex_exit(&ds->ds_lock); 3609 3610 dsl_dir_diduse_space(ds->ds_dir, DD_USED_REFRSRV, delta, 0, 0, tx); 3611 mutex_exit(&ds->ds_dir->dd_lock); |
3605 3606 spa_history_log_internal(LOG_DS_REFRESERV, 3607 ds->ds_dir->dd_pool->dp_spa, tx, "%lld dataset = %llu", 3608 (longlong_t)effective_value, ds->ds_object); | |
3609} 3610 3611int 3612dsl_dataset_set_reservation(const char *dsname, zprop_source_t source, 3613 uint64_t reservation) 3614{ 3615 dsl_dataset_t *ds; 3616 dsl_prop_setarg_t psa; --- 740 unchanged lines hidden --- | 3612} 3613 3614int 3615dsl_dataset_set_reservation(const char *dsname, zprop_source_t source, 3616 uint64_t reservation) 3617{ 3618 dsl_dataset_t *ds; 3619 dsl_prop_setarg_t psa; --- 740 unchanged lines hidden --- |