Fix commit callbacks
[zfs.git] / module / zfs / dmu_objset.c
index 7caebd9..2d06897 100644 (file)
@@ -528,8 +528,9 @@ void
 dmu_objset_evict(objset_t *os)
 {
        dsl_dataset_t *ds = os->os_dsl_dataset;
+       int t;
 
-       for (int t = 0; t < TXG_SIZE; t++)
+       for (t = 0; t < TXG_SIZE; t++)
                ASSERT(!dmu_objset_is_dirty(os, t));
 
        if (ds) {
@@ -1015,7 +1016,7 @@ dmu_objset_sync_dnodes(list_t *list, list_t *newlist, dmu_tx_t *tx)
 {
        dnode_t *dn;
 
-       while (dn = list_head(list)) {
+       while ((dn = list_head(list))) {
                ASSERT(dn->dn_object != DMU_META_DNODE_OBJECT);
                ASSERT(dn->dn_dbuf->db_data_pending);
                /*
@@ -1041,6 +1042,8 @@ dmu_objset_sync_dnodes(list_t *list, list_t *newlist, dmu_tx_t *tx)
 static void
 dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg)
 {
+       int i;
+
        blkptr_t *bp = zio->io_bp;
        objset_t *os = arg;
        dnode_phys_t *dnp = &os->os_phys->os_meta_dnode;
@@ -1056,7 +1059,7 @@ dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg)
         * dnode and user/group accounting objects).
         */
        bp->blk_fill = 0;
-       for (int i = 0; i < dnp->dn_nblkptr; i++)
+       for (i = 0; i < dnp->dn_nblkptr; i++)
                bp->blk_fill += dnp->dn_blkptr[i].blk_fill;
 }
 
@@ -1154,7 +1157,7 @@ dmu_objset_sync(objset_t *os, zio_t *pio, dmu_tx_t *tx)
        dmu_objset_sync_dnodes(&os->os_dirty_dnodes[txgoff], newlist, tx);
 
        list = &DMU_META_DNODE(os)->dn_dirty_records[txgoff];
-       while (dr = list_head(list)) {
+       while ((dr = list_head(list)) != NULL) {
                ASSERT(dr->dr_dbuf->db_level == 0);
                list_remove(list, dr);
                if (dr->dr_zio)
@@ -1178,7 +1181,9 @@ dmu_objset_is_dirty(objset_t *os, uint64_t txg)
 boolean_t
 dmu_objset_is_dirty_anywhere(objset_t *os)
 {
-       for (int t = 0; t < TXG_SIZE; t++)
+       int t;
+
+       for (t = 0; t < TXG_SIZE; t++)
                if (dmu_objset_is_dirty(os, t))
                        return (B_TRUE);
        return (B_FALSE);
@@ -1223,7 +1228,7 @@ dmu_objset_do_userquota_updates(objset_t *os, dmu_tx_t *tx)
 
        ASSERT(list_head(list) == NULL || dmu_objset_userused_enabled(os));
 
-       while (dn = list_head(list)) {
+       while ((dn = list_head(list)) != NULL) {
                int flags;
                ASSERT(!DMU_OBJECT_IS_SPECIAL(dn->dn_object));
                ASSERT(dn->dn_phys->dn_type == DMU_OT_NONE ||
@@ -1326,7 +1331,7 @@ dmu_objset_userquota_get_ids(dnode_t *dn, boolean_t before, dmu_tx_t *tx)
        objset_t *os = dn->dn_objset;
        void *data = NULL;
        dmu_buf_impl_t *db = NULL;
-       uint64_t *user, *group;
+       uint64_t *user = NULL, *group = NULL;
        int flags = dn->dn_id_flags;
        int error;
        boolean_t have_spill = B_FALSE;