X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=module%2Fzfs%2Fdsl_dataset.c;h=226e9882816c0a5f19b41b1187801caafc5e4b55;hb=4d58b69de8a6e2dc77b73e113d2c7847d389f456;hp=59ac4a60947a6bb045e9fd1693431c2156dd48e2;hpb=572e285762521df27fe5b026f409ba1a21abb7ac;p=zfs.git diff --git a/module/zfs/dsl_dataset.c b/module/zfs/dsl_dataset.c index 59ac4a6..226e988 100644 --- a/module/zfs/dsl_dataset.c +++ b/module/zfs/dsl_dataset.c @@ -85,11 +85,13 @@ parent_delta(dsl_dataset_t *ds, int64_t delta) void dsl_dataset_block_born(dsl_dataset_t *ds, const blkptr_t *bp, dmu_tx_t *tx) { - int used = bp_get_dsize_sync(tx->tx_pool->dp_spa, bp); - int compressed = BP_GET_PSIZE(bp); - int uncompressed = BP_GET_UCSIZE(bp); + int used, compressed, uncompressed; int64_t delta; + used = bp_get_dsize_sync(tx->tx_pool->dp_spa, bp); + compressed = BP_GET_PSIZE(bp); + uncompressed = BP_GET_UCSIZE(bp); + dprintf_bp(bp, "ds=%p", ds); ASSERT(dmu_tx_is_syncing(tx)); @@ -130,15 +132,17 @@ int dsl_dataset_block_kill(dsl_dataset_t *ds, const blkptr_t *bp, dmu_tx_t *tx, boolean_t async) { + int used, compressed, uncompressed; + if (BP_IS_HOLE(bp)) return (0); ASSERT(dmu_tx_is_syncing(tx)); ASSERT(bp->blk_birth <= tx->tx_txg); - int used = bp_get_dsize_sync(tx->tx_pool->dp_spa, bp); - int compressed = BP_GET_PSIZE(bp); - int uncompressed = BP_GET_UCSIZE(bp); + used = bp_get_dsize_sync(tx->tx_pool->dp_spa, bp); + compressed = BP_GET_PSIZE(bp); + uncompressed = BP_GET_UCSIZE(bp); ASSERT(used > 0); if (ds == NULL) { @@ -383,7 +387,7 @@ dsl_dataset_get_ref(dsl_pool_t *dp, uint64_t dsobj, void *tag, ds = dmu_buf_get_user(dbuf); if (ds == NULL) { - dsl_dataset_t *winner; + dsl_dataset_t *winner = NULL; ds = kmem_zalloc(sizeof (dsl_dataset_t), KM_SLEEP); ds->ds_dbuf = dbuf; @@ -1117,8 +1121,7 @@ dsl_dataset_destroy(dsl_dataset_t *ds, void *tag, boolean_t defer) */ if (ds->ds_phys->ds_bp.blk_fill == 0 && dmu_objset_userused_enabled(os)) { - uint64_t count; - + ASSERTV(uint64_t count); ASSERT(zap_count(os, DMU_USERUSED_OBJECT, &count) != 0 || count == 0); ASSERT(zap_count(os, DMU_GROUPUSED_OBJECT, &count) != 0 || @@ -1491,8 +1494,8 @@ static void remove_from_next_clones(dsl_dataset_t *ds, uint64_t obj, dmu_tx_t *tx) { objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset; - uint64_t count; int err; + ASSERTV(uint64_t count); ASSERT(ds->ds_phys->ds_num_children >= 2); err = zap_remove_int(mos, ds->ds_phys->ds_next_clones_obj, obj, tx); @@ -1772,6 +1775,7 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx) if (dsl_dataset_is_snapshot(ds_next)) { dsl_dataset_t *ds_nextnext; + dsl_dataset_t *hds; /* * Update next's unique to include blocks which @@ -1794,7 +1798,6 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx) ASSERT3P(ds_next->ds_prev, ==, NULL); /* Collapse range in this head. */ - dsl_dataset_t *hds; VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, ds->ds_dir->dd_phys->dd_head_dataset_obj, FTAG, &hds)); @@ -1917,7 +1920,7 @@ dsl_dataset_destroy_sync(void *arg1, void *tag, dmu_tx_t *tx) "dataset = %llu", ds->ds_object); if (ds->ds_phys->ds_next_clones_obj != 0) { - uint64_t count; + ASSERTV(uint64_t count); ASSERT(0 == zap_count(mos, ds->ds_phys->ds_next_clones_obj, &count) && count == 0); VERIFY(0 == dmu_object_free(mos, @@ -2247,7 +2250,7 @@ dsl_dataset_space(dsl_dataset_t *ds, boolean_t dsl_dataset_modified_since_lastsnap(dsl_dataset_t *ds) { - dsl_pool_t *dp = ds->ds_dir->dd_pool; + ASSERTV(dsl_pool_t *dp = ds->ds_dir->dd_pool); ASSERT(RW_LOCK_HELD(&dp->dp_config_rwlock) || dsl_pool_sync_context(dp)); @@ -2518,7 +2521,6 @@ struct promotearg { }; static int snaplist_space(list_t *l, uint64_t mintxg, uint64_t *spacep); -static boolean_t snaplist_unstable(list_t *l); static int dsl_dataset_promote_check(void *arg1, void *arg2, dmu_tx_t *tx) @@ -2919,10 +2921,11 @@ dsl_dataset_promote(const char *name, char *conflsnap) dsl_dir_t *dd; dsl_pool_t *dp; dmu_object_info_t doi; - struct promotearg pa = { 0 }; + struct promotearg pa; struct promotenode *snap; int err; + bzero(&pa, sizeof(struct promotearg)); err = dsl_dataset_hold(name, FTAG, &ds); if (err) return (err);