233 }
234 dsl_dir_rele(dd, dp);
235 if (err)
236 goto out;
237 }
238
239 if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
240 err = dsl_pool_open_special_dir(dp, FREE_DIR_NAME,
241 &dp->dp_free_dir);
242 if (err)
243 goto out;
244
245 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
246 DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj);
247 if (err)
248 goto out;
249 VERIFY0(bpobj_open(&dp->dp_free_bpobj,
250 dp->dp_meta_objset, obj));
251 }
252
253 if (spa_feature_is_active(dp->dp_spa,
254 &spa_feature_table[SPA_FEATURE_ASYNC_DESTROY])) {
255 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
256 DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1,
257 &dp->dp_bptree_obj);
258 if (err != 0)
259 goto out;
260 }
261
262 if (spa_feature_is_active(dp->dp_spa,
263 &spa_feature_table[SPA_FEATURE_EMPTY_BPOBJ])) {
264 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
265 DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1,
266 &dp->dp_empty_bpobj);
267 if (err != 0)
268 goto out;
269 }
270
271 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
272 DMU_POOL_TMP_USERREFS, sizeof (uint64_t), 1,
273 &dp->dp_tmp_userrefs_obj);
274 if (err == ENOENT)
275 err = 0;
276 if (err)
277 goto out;
278
279 err = dsl_scan_init(dp, dp->dp_tx.tx_open_txg);
280
281 out:
282 rrw_exit(&dp->dp_config_rwlock, FTAG);
283 return (err);
|
233 }
234 dsl_dir_rele(dd, dp);
235 if (err)
236 goto out;
237 }
238
239 if (spa_version(dp->dp_spa) >= SPA_VERSION_DEADLISTS) {
240 err = dsl_pool_open_special_dir(dp, FREE_DIR_NAME,
241 &dp->dp_free_dir);
242 if (err)
243 goto out;
244
245 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
246 DMU_POOL_FREE_BPOBJ, sizeof (uint64_t), 1, &obj);
247 if (err)
248 goto out;
249 VERIFY0(bpobj_open(&dp->dp_free_bpobj,
250 dp->dp_meta_objset, obj));
251 }
252
253 if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_ASYNC_DESTROY)) {
254 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
255 DMU_POOL_BPTREE_OBJ, sizeof (uint64_t), 1,
256 &dp->dp_bptree_obj);
257 if (err != 0)
258 goto out;
259 }
260
261 if (spa_feature_is_active(dp->dp_spa, SPA_FEATURE_EMPTY_BPOBJ)) {
262 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
263 DMU_POOL_EMPTY_BPOBJ, sizeof (uint64_t), 1,
264 &dp->dp_empty_bpobj);
265 if (err != 0)
266 goto out;
267 }
268
269 err = zap_lookup(dp->dp_meta_objset, DMU_POOL_DIRECTORY_OBJECT,
270 DMU_POOL_TMP_USERREFS, sizeof (uint64_t), 1,
271 &dp->dp_tmp_userrefs_obj);
272 if (err == ENOENT)
273 err = 0;
274 if (err)
275 goto out;
276
277 err = dsl_scan_init(dp, dp->dp_tx.tx_open_txg);
278
279 out:
280 rrw_exit(&dp->dp_config_rwlock, FTAG);
281 return (err);
|