]> granicus.if.org Git - zfs/commitdiff
Refresh gcc-unused branch
authorBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:21:43 +0000 (09:21 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Dec 2008 17:21:43 +0000 (09:21 -0800)
.topdeps [new file with mode: 0644]
.topmsg [new file with mode: 0644]
zfs/lib/libzpool/dbuf.c
zfs/lib/libzpool/dnode.c
zfs/lib/libzpool/dnode_sync.c
zfs/lib/libzpool/dsl_dataset.c
zfs/lib/libzpool/dsl_dir.c
zfs/lib/libzpool/dsl_prop.c
zfs/lib/libzpool/vdev.c
zfs/lib/libzpool/vdev_cache.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..ab4f41c
--- /dev/null
+++ b/.topmsg
@@ -0,0 +1,6 @@
+From: Brian Behlendorf <behlendorf1@llnl.gov>
+Subject: [PATCH] gcc-unused
+
+Gcc -Wall warn: 'unused variable'
+
+Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
index d04610317a4ea42fdcf1becc7584513d09969ca3..7c65c95a8270894853fbfc1bada06a5959acd870 100644 (file)
@@ -1736,8 +1736,7 @@ dbuf_create_bonus(dnode_t *dn)
 void
 dbuf_add_ref(dmu_buf_impl_t *db, void *tag)
 {
-       int64_t holds = refcount_add(&db->db_holds, tag);
-       ASSERT(holds > 1);
+       VERIFY(refcount_add(&db->db_holds, tag) > 1);
 }
 
 #pragma weak dmu_buf_rele = dbuf_rele
@@ -2326,17 +2325,15 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
                                ASSERT(arc_released(db->db_buf));
                }
        } else {
-               dnode_t *dn = db->db_dnode;
-
                ASSERT(list_head(&dr->dt.di.dr_children) == NULL);
-               ASSERT3U(db->db.db_size, ==, 1<<dn->dn_phys->dn_indblkshift);
+               ASSERT3U(db->db.db_size, ==,
+                        1<<db->db_dnode->dn_phys->dn_indblkshift);
                if (!BP_IS_HOLE(db->db_blkptr)) {
-                       int epbs =
-                           dn->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT;
                        ASSERT3U(BP_GET_LSIZE(db->db_blkptr), ==,
                            db->db.db_size);
-                       ASSERT3U(dn->dn_phys->dn_maxblkid
-                           >> (db->db_level * epbs), >=, db->db_blkid);
+                       ASSERT3U(db->db_dnode->dn_phys->dn_maxblkid >> (db->db_level *
+                           (db->db_dnode->dn_phys->dn_indblkshift - SPA_BLKPTRSHIFT)),
+                           >=, db->db_blkid);
                        arc_set_callback(db->db_buf, dbuf_do_evict, db);
                }
                mutex_destroy(&dr->dt.di.dr_mtx);
index e77834d60dcc3d3615f7e68ddf1032f094905116..d0b47d786be5742b25658787a165019ca21c345b 100644 (file)
@@ -40,7 +40,9 @@ static int free_range_compar(const void *node1, const void *node2);
 
 static kmem_cache_t *dnode_cache;
 
+#ifndef NDEBUG
 static dnode_phys_t dnode_phys_zero;
+#endif
 
 int zfs_default_bs = SPA_MINBLOCKSHIFT;
 int zfs_default_ibs = DN_MAX_INDBLKSHIFT;
@@ -518,11 +520,12 @@ dnode_buf_pageout(dmu_buf_t *db, void *arg)
 
        for (i = 0; i < epb; i++) {
                dnode_t *dn = children_dnodes[i];
-               int n;
 
                if (dn == NULL)
                        continue;
 #ifdef ZFS_DEBUG
+               {
+               int n;
                /*
                 * If there are holds on this dnode, then there should
                 * be holds on the dnode's containing dbuf as well; thus
@@ -535,6 +538,7 @@ dnode_buf_pageout(dmu_buf_t *db, void *arg)
 
                for (n = 0; n < TXG_SIZE; n++)
                        ASSERT(!list_link_active(&dn->dn_dirty_link[n]));
+               }
 #endif
                children_dnodes[i] = NULL;
                dnode_destroy(dn);
index 779cfc96f9e3c4eca3ed6c47b5a42bbcb6dbd3b7..3ead08de29e4504175b16ed2ac5e067ba89e765c 100644 (file)
@@ -319,8 +319,10 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
                ASSERT3U(blkid + nblks, <=, dn->dn_phys->dn_nblkptr);
                (void) free_blocks(dn, bp + blkid, nblks, tx);
                if (trunc) {
+#ifndef NDEBUG
                        uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
                            (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT);
+#endif
                        dn->dn_phys->dn_maxblkid = (blkid ? blkid - 1 : 0);
                        ASSERT(off < dn->dn_phys->dn_maxblkid ||
                            dn->dn_phys->dn_maxblkid == 0 ||
@@ -349,8 +351,10 @@ dnode_sync_free_range(dnode_t *dn, uint64_t blkid, uint64_t nblks, dmu_tx_t *tx)
                dbuf_rele(db, FTAG);
        }
        if (trunc) {
+#ifndef NDEBUG
                uint64_t off = (dn->dn_phys->dn_maxblkid + 1) *
                    (dn->dn_phys->dn_datablkszsec << SPA_MINBLOCKSHIFT);
+#endif
                dn->dn_phys->dn_maxblkid = (blkid ? blkid - 1 : 0);
                ASSERT(off < dn->dn_phys->dn_maxblkid ||
                    dn->dn_phys->dn_maxblkid == 0 ||
index 93ea8aa11173143d2cf963e6136c7b02b99b9d8e..c0bd82d1bb69f863cd8835f722f7b0575950e347 100644 (file)
@@ -1995,10 +1995,8 @@ 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;
-
-       ASSERT(RW_LOCK_HELD(&dp->dp_config_rwlock) ||
-           dsl_pool_sync_context(dp));
+       ASSERT(RW_LOCK_HELD(&(ds->ds_dir->dd_pool)->dp_config_rwlock) ||
+           dsl_pool_sync_context(ds->ds_dir->dd_pool));
        if (ds->ds_prev == NULL)
                return (B_FALSE);
        if (ds->ds_phys->ds_bp.blk_birth >
index 48d87f97f6698ead99c1d7e2c58bccc6e5f83a11..8c23d52e33ad44cb9670908a6e3b67160f19d20c 100644 (file)
@@ -48,11 +48,10 @@ static void
 dsl_dir_evict(dmu_buf_t *db, void *arg)
 {
        dsl_dir_t *dd = arg;
-       dsl_pool_t *dp = dd->dd_pool;
        int t;
 
        for (t = 0; t < TXG_SIZE; t++) {
-               ASSERT(!txg_list_member(&dp->dp_dirty_dirs, dd, t));
+               ASSERT(!txg_list_member(&dd->dd_pool->dp_dirty_dirs, dd, t));
                ASSERT(dd->dd_tempreserved[t] == 0);
                ASSERT(dd->dd_space_towrite[t] == 0);
        }
index 212acbbc5968848234e0f394c6dc3e483b0717ac..bb19f3e9e82641ca016dfe01c310c76f93d4698f 100644 (file)
@@ -370,7 +370,7 @@ dsl_prop_set_sync(void *arg1, void *arg2, cred_t *cr, dmu_tx_t *tx)
 
        if (psa->numints == 0) {
                int err = zap_remove(mos, zapobj, psa->name, tx);
-               ASSERT(err == 0 || err == ENOENT);
+               VERIFY(0 == err || ENOENT == err);
                if (isint) {
                        VERIFY(0 == dsl_prop_get_ds(ds,
                            psa->name, 8, 1, &intval, NULL));
index 16a27e514a41b6d1a0e29bceda2dc60d378914de..d73b6c5816c62d7fbc36dad2a98bbda5af99a8c1 100644 (file)
@@ -1414,8 +1414,7 @@ vdev_dtl_sync(vdev_t *vd, uint64_t txg)
 
        if (vd->vdev_detached) {
                if (smo->smo_object != 0) {
-                       int err = dmu_object_free(mos, smo->smo_object, tx);
-                       ASSERT3U(err, ==, 0);
+                       VERIFY(0 == dmu_object_free(mos, smo->smo_object, tx));
                        smo->smo_object = 0;
                }
                dmu_tx_commit(tx);
index 5a7b59f6ed845ee235eb671101ebab9136b8d149..cad0438c34d5f11649a0d5fdc0f34da7bb2ca843 100644 (file)
@@ -253,7 +253,6 @@ vdev_cache_read(zio_t *zio)
        vdev_cache_t *vc = &zio->io_vd->vdev_cache;
        vdev_cache_entry_t *ve, ve_search;
        uint64_t cache_offset = P2ALIGN(zio->io_offset, VCBS);
-       uint64_t cache_phase = P2PHASE(zio->io_offset, VCBS);
        zio_t *fio;
 
        ASSERT(zio->io_type == ZIO_TYPE_READ);
@@ -270,7 +269,7 @@ vdev_cache_read(zio_t *zio)
        if (P2BOUNDARY(zio->io_offset, zio->io_size, VCBS))
                return (EXDEV);
 
-       ASSERT(cache_phase + zio->io_size <= VCBS);
+       ASSERT(P2PHASE(zio->io_offset, VCBS) + zio->io_size <= VCBS);
 
        mutex_enter(&vc->vc_lock);