Fix missing newlines
[zfs.git] / module / zfs / dsl_dataset.c
index 59ac4a6..f6f1987 100644 (file)
@@ -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,12 +387,13 @@ 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;
                ds->ds_object = dsobj;
                ds->ds_phys = dbuf->db_data;
+               list_link_init(&ds->ds_synced_link);
 
                mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL);
                mutex_init(&ds->ds_recvlock, NULL, MUTEX_DEFAULT, NULL);
@@ -1117,8 +1122,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 +1495,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 +1776,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 +1799,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 +1921,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 +2251,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 +2522,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 +2922,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);