dsl_dataset.c (268659) | dsl_dataset.c (269006) |
---|---|
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 --- 1387 unchanged lines hidden (view full) --- 1396 ddsa.ddsa_snaps = snaps; 1397 ddsa.ddsa_props = props; 1398 ddsa.ddsa_errors = errors; 1399 ddsa.ddsa_cr = CRED(); 1400 1401 if (error == 0) { 1402 error = dsl_sync_task(firstname, dsl_dataset_snapshot_check, 1403 dsl_dataset_snapshot_sync, &ddsa, | 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 --- 1387 unchanged lines hidden (view full) --- 1396 ddsa.ddsa_snaps = snaps; 1397 ddsa.ddsa_props = props; 1398 ddsa.ddsa_errors = errors; 1399 ddsa.ddsa_cr = CRED(); 1400 1401 if (error == 0) { 1402 error = dsl_sync_task(firstname, dsl_dataset_snapshot_check, 1403 dsl_dataset_snapshot_sync, &ddsa, |
1404 fnvlist_num_pairs(snaps) * 3); | 1404 fnvlist_num_pairs(snaps) * 3, ZFS_SPACE_CHECK_NORMAL); |
1405 } 1406 1407 if (suspended != NULL) { 1408 for (pair = nvlist_next_nvpair(suspended, NULL); pair != NULL; 1409 pair = nvlist_next_nvpair(suspended, pair)) { 1410 zil_resume((void *)(uintptr_t) 1411 fnvpair_value_uint64(pair)); 1412 } --- 96 unchanged lines hidden (view full) --- 1509 1510 if (needsuspend) { 1511 error = zil_suspend(fsname, &cookie); 1512 if (error != 0) 1513 return (error); 1514 } 1515 1516 error = dsl_sync_task(fsname, dsl_dataset_snapshot_tmp_check, | 1405 } 1406 1407 if (suspended != NULL) { 1408 for (pair = nvlist_next_nvpair(suspended, NULL); pair != NULL; 1409 pair = nvlist_next_nvpair(suspended, pair)) { 1410 zil_resume((void *)(uintptr_t) 1411 fnvpair_value_uint64(pair)); 1412 } --- 96 unchanged lines hidden (view full) --- 1509 1510 if (needsuspend) { 1511 error = zil_suspend(fsname, &cookie); 1512 if (error != 0) 1513 return (error); 1514 } 1515 1516 error = dsl_sync_task(fsname, dsl_dataset_snapshot_tmp_check, |
1517 dsl_dataset_snapshot_tmp_sync, &ddsta, 3); | 1517 dsl_dataset_snapshot_tmp_sync, &ddsta, 3, ZFS_SPACE_CHECK_RESERVED); |
1518 1519 if (needsuspend) 1520 zil_resume(cookie); 1521 return (error); 1522} 1523 1524 1525void --- 354 unchanged lines hidden (view full) --- 1880 dsl_dataset_rename_snapshot_arg_t ddrsa; 1881 1882 ddrsa.ddrsa_fsname = fsname; 1883 ddrsa.ddrsa_oldsnapname = oldsnapname; 1884 ddrsa.ddrsa_newsnapname = newsnapname; 1885 ddrsa.ddrsa_recursive = recursive; 1886 1887 return (dsl_sync_task(fsname, dsl_dataset_rename_snapshot_check, | 1518 1519 if (needsuspend) 1520 zil_resume(cookie); 1521 return (error); 1522} 1523 1524 1525void --- 354 unchanged lines hidden (view full) --- 1880 dsl_dataset_rename_snapshot_arg_t ddrsa; 1881 1882 ddrsa.ddrsa_fsname = fsname; 1883 ddrsa.ddrsa_oldsnapname = oldsnapname; 1884 ddrsa.ddrsa_newsnapname = newsnapname; 1885 ddrsa.ddrsa_recursive = recursive; 1886 1887 return (dsl_sync_task(fsname, dsl_dataset_rename_snapshot_check, |
1888 dsl_dataset_rename_snapshot_sync, &ddrsa, 1)); | 1888 dsl_dataset_rename_snapshot_sync, &ddrsa, 1889 1, ZFS_SPACE_CHECK_RESERVED)); |
1889} 1890 1891/* 1892 * If we're doing an ownership handoff, we need to make sure that there is 1893 * only one long hold on the dataset. We're not allowed to change anything here 1894 * so we don't permanently release the long hold or regular hold here. We want 1895 * to do this only when syncing to avoid the dataset unexpectedly going away 1896 * when we release the long hold. --- 158 unchanged lines hidden (view full) --- 2055{ 2056 dsl_dataset_rollback_arg_t ddra; 2057 2058 ddra.ddra_fsname = fsname; 2059 ddra.ddra_owner = owner; 2060 ddra.ddra_result = result; 2061 2062 return (dsl_sync_task(fsname, dsl_dataset_rollback_check, | 1890} 1891 1892/* 1893 * If we're doing an ownership handoff, we need to make sure that there is 1894 * only one long hold on the dataset. We're not allowed to change anything here 1895 * so we don't permanently release the long hold or regular hold here. We want 1896 * to do this only when syncing to avoid the dataset unexpectedly going away 1897 * when we release the long hold. --- 158 unchanged lines hidden (view full) --- 2056{ 2057 dsl_dataset_rollback_arg_t ddra; 2058 2059 ddra.ddra_fsname = fsname; 2060 ddra.ddra_owner = owner; 2061 ddra.ddra_result = result; 2062 2063 return (dsl_sync_task(fsname, dsl_dataset_rollback_check, |
2063 dsl_dataset_rollback_sync, &ddra, 1)); | 2064 dsl_dataset_rollback_sync, &ddra, 2065 1, ZFS_SPACE_CHECK_RESERVED)); |
2064} 2065 2066struct promotenode { 2067 list_node_t link; 2068 dsl_dataset_t *ds; 2069}; 2070 2071typedef struct dsl_dataset_promote_arg { --- 504 unchanged lines hidden (view full) --- 2576 if (error != 0) 2577 return (error); 2578 2579 ddpa.ddpa_clonename = name; 2580 ddpa.err_ds = conflsnap; 2581 ddpa.cr = CRED(); 2582 2583 return (dsl_sync_task(name, dsl_dataset_promote_check, | 2066} 2067 2068struct promotenode { 2069 list_node_t link; 2070 dsl_dataset_t *ds; 2071}; 2072 2073typedef struct dsl_dataset_promote_arg { --- 504 unchanged lines hidden (view full) --- 2578 if (error != 0) 2579 return (error); 2580 2581 ddpa.ddpa_clonename = name; 2582 ddpa.err_ds = conflsnap; 2583 ddpa.cr = CRED(); 2584 2585 return (dsl_sync_task(name, dsl_dataset_promote_check, |
2584 dsl_dataset_promote_sync, &ddpa, 2 + numsnaps)); | 2586 dsl_dataset_promote_sync, &ddpa, 2587 2 + numsnaps, ZFS_SPACE_CHECK_RESERVED)); |
2585} 2586 2587int 2588dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, 2589 dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) 2590{ 2591 int64_t unused_refres_delta; 2592 --- 328 unchanged lines hidden (view full) --- 2921{ 2922 dsl_dataset_set_qr_arg_t ddsqra; 2923 2924 ddsqra.ddsqra_name = dsname; 2925 ddsqra.ddsqra_source = source; 2926 ddsqra.ddsqra_value = refquota; 2927 2928 return (dsl_sync_task(dsname, dsl_dataset_set_refquota_check, | 2588} 2589 2590int 2591dsl_dataset_clone_swap_check_impl(dsl_dataset_t *clone, 2592 dsl_dataset_t *origin_head, boolean_t force, void *owner, dmu_tx_t *tx) 2593{ 2594 int64_t unused_refres_delta; 2595 --- 328 unchanged lines hidden (view full) --- 2924{ 2925 dsl_dataset_set_qr_arg_t ddsqra; 2926 2927 ddsqra.ddsqra_name = dsname; 2928 ddsqra.ddsqra_source = source; 2929 ddsqra.ddsqra_value = refquota; 2930 2931 return (dsl_sync_task(dsname, dsl_dataset_set_refquota_check, |
2929 dsl_dataset_set_refquota_sync, &ddsqra, 0)); | 2932 dsl_dataset_set_refquota_sync, &ddsqra, 0, ZFS_SPACE_CHECK_NONE)); |
2930} 2931 2932static int 2933dsl_dataset_set_refreservation_check(void *arg, dmu_tx_t *tx) 2934{ 2935 dsl_dataset_set_qr_arg_t *ddsqra = arg; 2936 dsl_pool_t *dp = dmu_tx_pool(tx); 2937 dsl_dataset_t *ds; --- 98 unchanged lines hidden (view full) --- 3036{ 3037 dsl_dataset_set_qr_arg_t ddsqra; 3038 3039 ddsqra.ddsqra_name = dsname; 3040 ddsqra.ddsqra_source = source; 3041 ddsqra.ddsqra_value = refreservation; 3042 3043 return (dsl_sync_task(dsname, dsl_dataset_set_refreservation_check, | 2933} 2934 2935static int 2936dsl_dataset_set_refreservation_check(void *arg, dmu_tx_t *tx) 2937{ 2938 dsl_dataset_set_qr_arg_t *ddsqra = arg; 2939 dsl_pool_t *dp = dmu_tx_pool(tx); 2940 dsl_dataset_t *ds; --- 98 unchanged lines hidden (view full) --- 3039{ 3040 dsl_dataset_set_qr_arg_t ddsqra; 3041 3042 ddsqra.ddsqra_name = dsname; 3043 ddsqra.ddsqra_source = source; 3044 ddsqra.ddsqra_value = refreservation; 3045 3046 return (dsl_sync_task(dsname, dsl_dataset_set_refreservation_check, |
3044 dsl_dataset_set_refreservation_sync, &ddsqra, 0)); | 3047 dsl_dataset_set_refreservation_sync, &ddsqra, 3048 0, ZFS_SPACE_CHECK_NONE)); |
3045} 3046 3047/* 3048 * Return (in *usedp) the amount of space written in new that is not 3049 * present in oldsnap. New may be a snapshot or the head. Old must be 3050 * a snapshot before new, in new's filesystem (or its origin). If not then 3051 * fail and return EINVAL. 3052 * --- 196 unchanged lines hidden --- | 3049} 3050 3051/* 3052 * Return (in *usedp) the amount of space written in new that is not 3053 * present in oldsnap. New may be a snapshot or the head. Old must be 3054 * a snapshot before new, in new's filesystem (or its origin). If not then 3055 * fail and return EINVAL. 3056 * --- 196 unchanged lines hidden --- |