Update gcc-unused

Fix new instances or changes in gcc flagged unused code.  These are
mostly related to variables which are not used when debugging is
disabled and the ASSERTs are compiled out.
This commit is contained in:
Brian Behlendorf 2010-06-14 15:29:48 -07:00
parent d60fc5ca30
commit d8e123dc27
10 changed files with 13 additions and 16 deletions

View File

@ -2176,7 +2176,7 @@ get_interval_count(int *argcp, char **argv, unsigned long *iv,
unsigned long *cnt)
{
unsigned long interval = 0, count = 0;
int argc = *argcp, errno;
int argc = *argcp;
/*
* Determine if the last argument is an integer or a pool name

View File

@ -2303,7 +2303,7 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb)
#ifdef ZFS_DEBUG
if (db->db_blkid == DMU_SPILL_BLKID) {
dnode_t *dn = db->db_dnode;
ASSERTV(dnode_t *dn = db->db_dnode);
ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR);
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
db->db_blkptr == &dn->dn_phys->dn_spill);
@ -2382,7 +2382,7 @@ dbuf_write_done(zio_t *zio, arc_buf_t *buf, void *vdb)
#ifdef ZFS_DEBUG
if (db->db_blkid == DMU_SPILL_BLKID) {
dnode_t *dn = db->db_dnode;
ASSERTV(dnode_t *dn = db->db_dnode);
ASSERT(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR);
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
db->db_blkptr == &dn->dn_phys->dn_spill);

View File

@ -1146,8 +1146,8 @@ dmu_sync_ready(zio_t *zio, arc_buf_t *buf, void *varg)
{
dmu_sync_arg_t *dsa = varg;
dmu_buf_t *db = dsa->dsa_zgd->zgd_db;
dnode_t *dn = ((dmu_buf_impl_t *)db)->db_dnode;
blkptr_t *bp = zio->io_bp;
ASSERTV(dnode_t *dn = ((dmu_buf_impl_t *)db)->db_dnode);
if (zio->io_error == 0) {
if (BP_IS_HOLE(bp)) {

View File

@ -954,7 +954,6 @@ dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg)
blkptr_t *bp = zio->io_bp;
objset_t *os = arg;
dnode_phys_t *dnp = &os->os_phys->os_meta_dnode;
ASSERTV(blkptr_t *bp_orig = &zio->io_bp_orig);
ASSERT(bp == os->os_rootbp);
ASSERT(BP_GET_TYPE(bp) == DMU_OT_OBJSET);

View File

@ -1466,8 +1466,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);
@ -2474,7 +2474,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)

View File

@ -1121,9 +1121,9 @@ sa_byteswap(sa_handle_t *hdl, sa_buf_type_t buftype)
{
sa_hdr_phys_t *sa_hdr_phys = SA_GET_HDR(hdl, buftype);
dmu_buf_impl_t *db;
sa_os_t *sa = hdl->sa_os->os_sa;
int num_lengths = 1;
int i;
ASSERTV(sa_os_t *sa = hdl->sa_os->os_sa);
ASSERT(MUTEX_HELD(&sa->sa_lock));
if (sa_hdr_phys->sa_magic == SA_MAGIC)
@ -1224,7 +1224,7 @@ sa_idx_tab_rele(objset_t *os, void *arg)
static void
sa_idx_tab_hold(objset_t *os, sa_idx_tab_t *idx_tab)
{
sa_os_t *sa = os->os_sa;
ASSERTV(sa_os_t *sa = os->os_sa);
ASSERT(MUTEX_HELD(&sa->sa_lock));
(void) refcount_add(&idx_tab->sa_refcount, NULL);
@ -1260,10 +1260,10 @@ sa_handle_get_from_db(objset_t *os, dmu_buf_t *db, void *userp,
sa_handle_type_t hdl_type, sa_handle_t **handlepp)
{
int error = 0;
dmu_object_info_t doi;
sa_handle_t *handle;
#ifdef ZFS_DEBUG
dmu_object_info_t doi;
dmu_object_info_from_db(db, &doi);
ASSERT(doi.doi_bonus_type == DMU_OT_SA ||
doi.doi_bonus_type == DMU_OT_ZNODE);

View File

@ -1401,8 +1401,8 @@ vdev_validate(vdev_t *vd)
void
vdev_close(vdev_t *vd)
{
ASSERTV(spa_t *spa = vd->vdev_spa);
vdev_t *pvd = vd->vdev_parent;
ASSERTV(spa_t *spa = vd->vdev_spa);
ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL);

View File

@ -1043,12 +1043,13 @@ zap_update(objset_t *os, uint64_t zapobj, const char *name,
{
zap_t *zap;
mzap_ent_t *mze;
uint64_t oldval;
const uint64_t *intval = val;
zap_name_t *zn;
int err;
#ifdef ZFS_DEBUG
uint64_t oldval;
/*
* If there is an old value, it shouldn't change across the
* lockdir (eg, due to bprewrite's xlation).

View File

@ -78,8 +78,6 @@ boolean_t zfs_nocacheflush = B_FALSE;
static kmem_cache_t *zil_lwb_cache;
static boolean_t zil_empty(zilog_t *zilog);
#define LWB_EMPTY(lwb) ((BP_GET_LSIZE(&lwb->lwb_blk) - \
sizeof (zil_chain_t)) == (lwb->lwb_sz - lwb->lwb_nused))

View File

@ -1939,12 +1939,12 @@ static void
zio_ddt_ditto_write_done(zio_t *zio)
{
int p = DDT_PHYS_DITTO;
zio_prop_t *zp = &zio->io_prop;
blkptr_t *bp = zio->io_bp;
ddt_t *ddt = ddt_select(zio->io_spa, bp);
ddt_entry_t *dde = zio->io_private;
ddt_phys_t *ddp = &dde->dde_phys[p];
ddt_key_t *ddk = &dde->dde_key;
ASSERTV(zio_prop_t *zp = &zio->io_prop);
ddt_enter(ddt);