dmu_send.c (321612) | dmu_send.c (339110) |
---|---|
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 --- 62 unchanged lines hidden (view full) --- 71 72#ifdef _KERNEL 73TUNABLE_INT("vfs.zfs.send_set_freerecords_bit", &zfs_send_set_freerecords_bit); 74#endif 75 76static char *dmu_recv_tag = "dmu_recv_tag"; 77const char *recv_clone_name = "%recv"; 78 | 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 --- 62 unchanged lines hidden (view full) --- 71 72#ifdef _KERNEL 73TUNABLE_INT("vfs.zfs.send_set_freerecords_bit", &zfs_send_set_freerecords_bit); 74#endif 75 76static char *dmu_recv_tag = "dmu_recv_tag"; 77const char *recv_clone_name = "%recv"; 78 |
79/* 80 * Use this to override the recordsize calculation for fast zfs send estimates. 81 */ 82uint64_t zfs_override_estimate_recordsize = 0; 83 |
|
79#define BP_SPAN(datablkszsec, indblkshift, level) \ 80 (((uint64_t)datablkszsec) << (SPA_MINBLOCKSHIFT + \ 81 (level) * (indblkshift - SPA_BLKPTRSHIFT))) 82 83static void byteswap_record(dmu_replay_record_t *drr); 84 85struct send_thread_arg { 86 bqueue_t q; --- 1039 unchanged lines hidden (view full) --- 1126 dsl_dataset_rele(ds, FTAG); 1127 return (err); 1128} 1129 1130static int 1131dmu_adjust_send_estimate_for_indirects(dsl_dataset_t *ds, uint64_t uncompressed, 1132 uint64_t compressed, boolean_t stream_compressed, uint64_t *sizep) 1133{ | 84#define BP_SPAN(datablkszsec, indblkshift, level) \ 85 (((uint64_t)datablkszsec) << (SPA_MINBLOCKSHIFT + \ 86 (level) * (indblkshift - SPA_BLKPTRSHIFT))) 87 88static void byteswap_record(dmu_replay_record_t *drr); 89 90struct send_thread_arg { 91 bqueue_t q; --- 1039 unchanged lines hidden (view full) --- 1131 dsl_dataset_rele(ds, FTAG); 1132 return (err); 1133} 1134 1135static int 1136dmu_adjust_send_estimate_for_indirects(dsl_dataset_t *ds, uint64_t uncompressed, 1137 uint64_t compressed, boolean_t stream_compressed, uint64_t *sizep) 1138{ |
1134 int err; | 1139 int err = 0; |
1135 uint64_t size; 1136 /* 1137 * Assume that space (both on-disk and in-stream) is dominated by 1138 * data. We will adjust for indirect blocks and the copies property, 1139 * but ignore per-object space used (eg, dnodes and DRR_OBJECT records). 1140 */ 1141 uint64_t recordsize; 1142 uint64_t record_count; 1143 objset_t *os; 1144 VERIFY0(dmu_objset_from_ds(ds, &os)); 1145 1146 /* Assume all (uncompressed) blocks are recordsize. */ | 1140 uint64_t size; 1141 /* 1142 * Assume that space (both on-disk and in-stream) is dominated by 1143 * data. We will adjust for indirect blocks and the copies property, 1144 * but ignore per-object space used (eg, dnodes and DRR_OBJECT records). 1145 */ 1146 uint64_t recordsize; 1147 uint64_t record_count; 1148 objset_t *os; 1149 VERIFY0(dmu_objset_from_ds(ds, &os)); 1150 1151 /* Assume all (uncompressed) blocks are recordsize. */ |
1147 if (os->os_phys->os_type == DMU_OST_ZVOL) { | 1152 if (zfs_override_estimate_recordsize != 0) { 1153 recordsize = zfs_override_estimate_recordsize; 1154 } else if (os->os_phys->os_type == DMU_OST_ZVOL) { |
1148 err = dsl_prop_get_int_ds(ds, 1149 zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &recordsize); 1150 } else { 1151 err = dsl_prop_get_int_ds(ds, 1152 zfs_prop_to_name(ZFS_PROP_RECORDSIZE), &recordsize); 1153 } 1154 if (err != 0) 1155 return (err); --- 2218 unchanged lines hidden --- | 1155 err = dsl_prop_get_int_ds(ds, 1156 zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE), &recordsize); 1157 } else { 1158 err = dsl_prop_get_int_ds(ds, 1159 zfs_prop_to_name(ZFS_PROP_RECORDSIZE), &recordsize); 1160 } 1161 if (err != 0) 1162 return (err); --- 2218 unchanged lines hidden --- |