]> granicus.if.org Git - zfs/commitdiff
Refresh gcc-no-parenthesis branch
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:09:02 +0000 (09:09 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:09:02 +0000 (09:09 -0800)
20 files changed:
.topdeps [new file with mode: 0644]
.topmsg [new file with mode: 0644]
zfs/lib/libnvpair/nvpair.c
zfs/lib/libspl/u8_textprep.c
zfs/lib/libzcommon/zfs_deleg.c
zfs/lib/libzfs/libzfs_dataset.c
zfs/lib/libzpool/arc.c
zfs/lib/libzpool/dbuf.c
zfs/lib/libzpool/dmu_objset.c
zfs/lib/libzpool/dmu_tx.c
zfs/lib/libzpool/dnode.c
zfs/lib/libzpool/dnode_sync.c
zfs/lib/libzpool/dsl_deleg.c
zfs/lib/libzpool/dsl_dir.c
zfs/lib/libzpool/dsl_pool.c
zfs/lib/libzpool/dsl_synctask.c
zfs/lib/libzpool/refcount.c
zfs/lib/libzpool/spa.c
zfs/lib/libzpool/vdev.c
zfs/lib/libzpool/zap_micro.c

diff --git a/.topdeps b/.topdeps
new file mode 100644 (file)
index 0000000..1f7391f
--- /dev/null
+++ b/.topdeps
@@ -0,0 +1 @@
+master
diff --git a/.topmsg b/.topmsg
new file mode 100644 (file)
index 0000000..e6a4cae
--- /dev/null
+++ b/.topmsg
@@ -0,0 +1,6 @@
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Subject: [PATCH] gcc-no-parenthesis
+
+Gcc -Wall warn: 'missing parenthesis'
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
index 77891bf7764451de33b5bd18dfeb4453c40cd47b..cee02a04bdc3285ba051b54b0962786fef67d821 100644 (file)
@@ -2331,7 +2331,7 @@ nvlist_xpack(nvlist_t *nvl, char **bufp, size_t *buflen, int encoding,
         */
        nv_priv_init(&nvpriv, nva, 0);
 
-       if (err = nvlist_size(nvl, &alloc_size, encoding))
+       if ((err = nvlist_size(nvl, &alloc_size, encoding)))
                return (err);
 
        if ((buf = nv_mem_zalloc(&nvpriv, alloc_size)) == NULL)
index 8faf1a97e47eb03e087f6c5c47f570e42949b43d..35cafbaa9a541c3ec416e4583532245764108657 100644 (file)
 
 /* The following are some convenience macros. */
 #define        U8_PUT_3BYTES_INTO_UTF32(u, b1, b2, b3) \
-       (u) = ((uint32_t)(b1) & 0x0F) << 12 | ((uint32_t)(b2) & 0x3F) << 6 | \
-               (uint32_t)(b3) & 0x3F;
+       (u) = (((uint32_t)(b1) & 0x0F) << 12) | \
+             (((uint32_t)(b2) & 0x3F) << 6) |  \
+              ((uint32_t)(b3) & 0x3F);
 
 #define        U8_SIMPLE_SWAP(a, b, t) \
        (t) = (a); \
index 0fd5800a84dc5074fcbd54a16ae5276973bc0b90..1b94a2856148e704da1a37b9498e94bdc331048e 100644 (file)
@@ -179,8 +179,8 @@ zfs_deleg_verify_nvlist(nvlist_t *nvp)
                            nvpair_name(perm_name));
                        if (error)
                                return (-1);
-               } while (perm_name = nvlist_next_nvpair(perms, perm_name));
-       } while (who = nvlist_next_nvpair(nvp, who));
+               } while ((perm_name = nvlist_next_nvpair(perms, perm_name)));
+       } while ((who = nvlist_next_nvpair(nvp, who)));
        return (0);
 }
 
index a8005ffc0cf53a745ee788e537ad66c99a9db6b4..f0076e43146c846e686adc95c3de181244a05760 100644 (file)
@@ -1205,7 +1205,7 @@ zfs_build_perms(zfs_handle_t *zhp, char *whostr, char *perms,
                zfs_perms_add_who_nvlist(who_nvp, who_id, who_tok,
                    perms_nvp, sets_nvp, who_type, inherit);
 
-       } while (who_tok = strtok(NULL, ","));
+       } while ((who_tok = strtok(NULL, ",")));
        *nvp = who_nvp;
        return (0);
 }
@@ -1610,9 +1610,9 @@ zfs_perm_get(zfs_handle_t *zhp, zfs_allow_t **zfs_perms)
                                if (zfs_coalesce_perm(zhp, allownode,
                                    nvpair_name(perm_pair), ld) != 0)
                                        goto abort;
-                       } while (perm_pair = nvlist_next_nvpair(permnv,
-                           perm_pair));
-               } while (who_pair = nvlist_next_nvpair(sourcenv, who_pair));
+                       } while ((perm_pair = nvlist_next_nvpair(permnv,
+                                 perm_pair)));
+               } while ((who_pair = nvlist_next_nvpair(sourcenv, who_pair)));
 
                source_pair = nvlist_next_nvpair(nvlist, source_pair);
                if (source_pair == NULL)
@@ -2828,7 +2828,7 @@ create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
         * up to the prefixlen-long one.
         */
        for (cp = target + prefixlen + 1;
-           cp = strchr(cp, '/'); *cp = '/', cp++) {
+           (cp = strchr(cp, '/')); *cp = '/', cp++) {
                char *logstr;
 
                *cp = '\0';
@@ -3683,7 +3683,7 @@ zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
         */
        if ((zhp->zfs_type == ZFS_TYPE_VOLUME) &&
            (zhp = make_dataset_handle(zhp->zfs_hdl, zhp->zfs_name))) {
-               if (err = zvol_create_link(zhp->zfs_hdl, zhp->zfs_name)) {
+               if ((err = zvol_create_link(zhp->zfs_hdl, zhp->zfs_name))) {
                        zfs_close(zhp);
                        return (err);
                }
index 73aecb2852d5282d1c1c9551ee0e51ba50a612b4..86e1b8e948853946a12be65e6fa01b96a18962ce 100644 (file)
@@ -3309,7 +3309,7 @@ arc_tempreserve_space(uint64_t reserve, uint64_t txg)
         * in order to compress/encrypt/etc the data.  We therefor need to
         * make sure that there is sufficient available memory for this.
         */
-       if (error = arc_memory_throttle(reserve, txg))
+       if ((error = arc_memory_throttle(reserve, txg)))
                return (error);
 
        /*
index d04610317a4ea42fdcf1becc7584513d09969ca3..4cd1defc1acdc479f1f54de7c3e86be01fc297f4 100644 (file)
@@ -1575,7 +1575,7 @@ dbuf_prefetch(dnode_t *dn, uint64_t blkid)
                return;
 
        /* dbuf_find() returns with db_mtx held */
-       if (db = dbuf_find(dn, 0, blkid)) {
+       if ((db = dbuf_find(dn, 0, blkid))) {
                if (refcount_count(&db->db_holds) > 0) {
                        /*
                         * This dbuf is active.  We assume that it is
@@ -2094,7 +2094,7 @@ dbuf_sync_list(list_t *list, dmu_tx_t *tx)
 {
        dbuf_dirty_record_t *dr;
 
-       while (dr = list_head(list)) {
+       while ((dr = list_head(list))) {
                if (dr->dr_zio != NULL) {
                        /*
                         * If we find an already initialized zio then we
index 7981e06825c472b2d3b896d0b48dd1be9f6c9b77..b4c4c98cc664d7d6941051eee51d0b070a44e8e0 100644 (file)
@@ -803,7 +803,7 @@ dmu_objset_snapshot(char *fsname, char *snapname, boolean_t recursive)
        }
 
 out:
-       while (osn = list_head(&sn.objsets)) {
+       while ((osn = list_head(&sn.objsets))) {
                list_remove(&sn.objsets, osn);
                zil_resume(dmu_objset_zil(osn->os));
                dmu_objset_close(osn->os);
@@ -823,7 +823,7 @@ dmu_objset_sync_dnodes(list_t *list, 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);
                /*
@@ -931,7 +931,7 @@ dmu_objset_sync(objset_impl_t *os, zio_t *pio, dmu_tx_t *tx)
        dmu_objset_sync_dnodes(&os->os_dirty_dnodes[txgoff], tx);
 
        list = &os->os_meta_dnode->dn_dirty_records[txgoff];
-       while (dr = list_head(list)) {
+       while ((dr = list_head(list))) {
                ASSERT(dr->dr_dbuf->db_level == 0);
                list_remove(list, dr);
                if (dr->dr_zio)
index bf560e5657c1c2db023e072b4f3e56418e2bd558..18a640d6d0412c97e8db336c13f01219a10f1fdd 100644 (file)
@@ -999,7 +999,7 @@ dmu_tx_commit(dmu_tx_t *tx)
 
        ASSERT(tx->tx_txg != 0);
 
-       while (txh = list_head(&tx->tx_holds)) {
+       while ((txh = list_head(&tx->tx_holds))) {
                dnode_t *dn = txh->txh_dnode;
 
                list_remove(&tx->tx_holds, txh);
@@ -1042,7 +1042,7 @@ dmu_tx_abort(dmu_tx_t *tx)
 
        ASSERT(tx->tx_txg == 0);
 
-       while (txh = list_head(&tx->tx_holds)) {
+       while ((txh = list_head(&tx->tx_holds))) {
                dnode_t *dn = txh->txh_dnode;
 
                list_remove(&tx->tx_holds, txh);
index e77834d60dcc3d3615f7e68ddf1032f094905116..88070436f463b3a5517bd8434be563671e168d0f 100644 (file)
@@ -601,8 +601,8 @@ dnode_hold_impl(objset_impl_t *os, uint64_t object, int flag,
                dnode_t **winner;
                children_dnodes = kmem_zalloc(epb * sizeof (dnode_t *),
                    KM_SLEEP);
-               if (winner = dmu_buf_set_user(&db->db, children_dnodes, NULL,
-                   dnode_buf_pageout)) {
+               if ((winner = dmu_buf_set_user(&db->db, children_dnodes, NULL,
+                   dnode_buf_pageout))) {
                        kmem_free(children_dnodes, epb * sizeof (dnode_t *));
                        children_dnodes = winner;
                }
index 779cfc96f9e3c4eca3ed6c47b5a42bbcb6dbd3b7..c1c77060a7a7ea83053d4bdd156d6961e29a0849 100644 (file)
@@ -422,7 +422,7 @@ dnode_undirty_dbufs(list_t *list)
 {
        dbuf_dirty_record_t *dr;
 
-       while (dr = list_head(list)) {
+       while ((dr = list_head(list))) {
                dmu_buf_impl_t *db = dr->dr_dbuf;
                uint64_t txg = dr->dr_txg;
 
index da5d15787570ff97b9524df75c680bd54e777c15..24f68b89db5e674ca6da84ff170d0cca8ca31d0b 100644 (file)
@@ -101,13 +101,13 @@ dsl_deleg_can_allow(char *ddname, nvlist_t *nvp, cred_t *cr)
        if ((error = dsl_deleg_access(ddname, ZFS_DELEG_PERM_ALLOW, cr)) != 0)
                return (error);
 
-       while (whopair = nvlist_next_nvpair(nvp, whopair)) {
+       while ((whopair = nvlist_next_nvpair(nvp, whopair))) {
                nvlist_t *perms;
                nvpair_t *permpair = NULL;
 
                VERIFY(nvpair_value_nvlist(whopair, &perms) == 0);
 
-               while (permpair = nvlist_next_nvpair(perms, permpair)) {
+               while ((permpair = nvlist_next_nvpair(perms, permpair))) {
                        const char *perm = nvpair_name(permpair);
 
                        if (strcmp(perm, ZFS_DELEG_PERM_ALLOW) == 0)
@@ -138,7 +138,7 @@ dsl_deleg_can_unallow(char *ddname, nvlist_t *nvp, cred_t *cr)
        (void) snprintf(idstr, sizeof (idstr), "%lld",
            (longlong_t)crgetuid(cr));
 
-       while (whopair = nvlist_next_nvpair(nvp, whopair)) {
+       while ((whopair = nvlist_next_nvpair(nvp, whopair))) {
                zfs_deleg_who_type_t type = nvpair_name(whopair)[0];
 
                if (type != ZFS_DELEG_USER &&
@@ -166,7 +166,7 @@ dsl_deleg_set_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx)
                    DMU_OT_DSL_PERMS, DMU_OT_NONE, 0, tx);
        }
 
-       while (whopair = nvlist_next_nvpair(nvp, whopair)) {
+       while ((whopair = nvlist_next_nvpair(nvp, whopair))) {
                const char *whokey = nvpair_name(whopair);
                nvlist_t *perms;
                nvpair_t *permpair = NULL;
@@ -181,7 +181,7 @@ dsl_deleg_set_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx)
                            whokey, 8, 1, &jumpobj, tx) == 0);
                }
 
-               while (permpair = nvlist_next_nvpair(perms, permpair)) {
+               while ((permpair = nvlist_next_nvpair(perms, permpair))) {
                        const char *perm = nvpair_name(permpair);
                        uint64_t n = 0;
 
@@ -207,7 +207,7 @@ dsl_deleg_unset_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx)
        if (zapobj == 0)
                return;
 
-       while (whopair = nvlist_next_nvpair(nvp, whopair)) {
+       while ((whopair = nvlist_next_nvpair(nvp, whopair))) {
                const char *whokey = nvpair_name(whopair);
                nvlist_t *perms;
                nvpair_t *permpair = NULL;
@@ -229,7 +229,7 @@ dsl_deleg_unset_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx)
                if (zap_lookup(mos, zapobj, whokey, 8, 1, &jumpobj) != 0)
                        continue;
 
-               while (permpair = nvlist_next_nvpair(perms, permpair)) {
+               while ((permpair = nvlist_next_nvpair(perms, permpair))) {
                        const char *perm = nvpair_name(permpair);
                        uint64_t n = 0;
 
@@ -266,7 +266,7 @@ dsl_deleg_set(const char *ddname, nvlist_t *nvp, boolean_t unset)
                return (ENOTSUP);
        }
 
-       while (whopair = nvlist_next_nvpair(nvp, whopair))
+       while ((whopair = nvlist_next_nvpair(nvp, whopair)))
                blocks_modified++;
 
        error = dsl_sync_task_do(dd->dd_pool, NULL,
index 48d87f97f6698ead99c1d7e2c58bccc6e5f83a11..0e157892b844af2fda0010e793c64b548ed705c9 100644 (file)
@@ -870,7 +870,7 @@ dsl_dir_tempreserve_clear(void *tr_cookie, dmu_tx_t *tx)
        if (tr_cookie == NULL)
                return;
 
-       while (tr = list_head(tr_list)) {
+       while ((tr = list_head(tr_list))) {
                if (tr->tr_dp) {
                        dsl_pool_tempreserve_clear(tr->tr_dp, tr->tr_size, tx);
                } else if (tr->tr_ds) {
@@ -1221,8 +1221,8 @@ dsl_dir_rename_check(void *arg1, void *arg2, dmu_tx_t *tx)
                if (closest_common_ancestor(dd, ra->newparent) == dd)
                        return (EINVAL);
 
-               if (err = dsl_dir_transfer_possible(dd->dd_parent,
-                   ra->newparent, myspace))
+               if ((err = dsl_dir_transfer_possible(dd->dd_parent,
+                   ra->newparent, myspace)))
                        return (err);
        }
 
index dacc57c81c25447f502b0bc71c318317f7d90892..722662e621f16a5273a7fb8f88fb015e67277604 100644 (file)
@@ -297,7 +297,7 @@ dsl_pool_sync(dsl_pool_t *dp, uint64_t txg)
 
        dp->dp_read_overhead = 0;
        zio = zio_root(dp->dp_spa, NULL, NULL, ZIO_FLAG_MUSTSUCCEED);
-       while (ds = txg_list_remove(&dp->dp_dirty_datasets, txg)) {
+       while ((ds = txg_list_remove(&dp->dp_dirty_datasets, txg))) {
                if (!list_link_active(&ds->ds_synced_link))
                        list_insert_tail(&dp->dp_synced_datasets, ds);
                else
@@ -386,7 +386,7 @@ dsl_pool_zil_clean(dsl_pool_t *dp)
 {
        dsl_dataset_t *ds;
 
-       while (ds = list_head(&dp->dp_synced_datasets)) {
+       while ((ds = list_head(&dp->dp_synced_datasets))) {
                list_remove(&dp->dp_synced_datasets, ds);
                ASSERT(ds->ds_user_ptr != NULL);
                zil_clean(((objset_impl_t *)ds->ds_user_ptr)->os_zil);
index 21100225abf7370d92bf012144421d1ad149f45c..9bb9c458046abfc42c953e3746834d84db7d87c3 100644 (file)
@@ -139,7 +139,7 @@ dsl_sync_task_group_destroy(dsl_sync_task_group_t *dstg)
 {
        dsl_sync_task_t *dst;
 
-       while (dst = list_head(&dstg->dstg_tasks)) {
+       while ((dst = list_head(&dstg->dstg_tasks))) {
                list_remove(&dstg->dstg_tasks, dst);
                kmem_free(dst, sizeof (dsl_sync_task_t));
        }
index f1b3b23fe2b3b1dc9c8e98fec705ec5f2074ead0..2a52cb16dabbb1f1a62c3c6a4eba3f88ee3efd22 100644 (file)
@@ -75,13 +75,13 @@ refcount_destroy_many(refcount_t *rc, uint64_t number)
        reference_t *ref;
 
        ASSERT(rc->rc_count == number);
-       while (ref = list_head(&rc->rc_list)) {
+       while ((ref = list_head(&rc->rc_list))) {
                list_remove(&rc->rc_list, ref);
                kmem_cache_free(reference_cache, ref);
        }
        list_destroy(&rc->rc_list);
 
-       while (ref = list_head(&rc->rc_removed)) {
+       while ((ref = list_head(&rc->rc_removed))) {
                list_remove(&rc->rc_removed, ref);
                kmem_cache_free(reference_history_cache, ref->ref_removed);
                kmem_cache_free(reference_cache, ref);
index fb1b96f8b811754e4f4d524977a629ce9f7834f3..3c49196a4ace641361d531a12363392f0e2f8aff 100644 (file)
@@ -3994,7 +3994,7 @@ spa_sync(spa_t *spa, uint64_t txg)
                dsl_pool_sync(dp, txg);
 
                dirty_vdevs = 0;
-               while (vd = txg_list_remove(&spa->spa_vdev_txg_list, txg)) {
+               while ((vd = txg_list_remove(&spa->spa_vdev_txg_list, txg))) {
                        vdev_sync(vd, txg);
                        dirty_vdevs++;
                }
@@ -4078,7 +4078,7 @@ spa_sync(spa_t *spa, uint64_t txg)
        /*
         * Update usable space statistics.
         */
-       while (vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg)))
+       while ((vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg))))
                vdev_sync_done(vd, txg);
 
        /*
index 16a27e514a41b6d1a0e29bceda2dc60d378914de..e7408daf29a587dee41f5778763e5f108cba3e4c 100644 (file)
@@ -1578,7 +1578,7 @@ vdev_sync_done(vdev_t *vd, uint64_t txg)
 {
        metaslab_t *msp;
 
-       while (msp = txg_list_remove(&vd->vdev_ms_list, TXG_CLEAN(txg)))
+       while ((msp = txg_list_remove(&vd->vdev_ms_list, TXG_CLEAN(txg))))
                metaslab_sync_done(msp, txg);
 }
 
index abba42775bb76a865d491cae64e7a4111b7ab9ec..b602f3984c9cf4d651cfd38a35c3c6101061d9de 100644 (file)
@@ -271,7 +271,7 @@ mze_destroy(zap_t *zap)
        mzap_ent_t *mze;
        void *avlcookie = NULL;
 
-       while (mze = avl_destroy_nodes(&zap->zap_m.zap_avl, &avlcookie))
+       while ((mze = avl_destroy_nodes(&zap->zap_m.zap_avl, &avlcookie)))
                kmem_free(mze, sizeof (mzap_ent_t));
        avl_destroy(&zap->zap_m.zap_avl);
 }