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:
parent
d60fc5ca30
commit
d8e123dc27
|
@ -2176,7 +2176,7 @@ get_interval_count(int *argcp, char **argv, unsigned long *iv,
|
||||||
unsigned long *cnt)
|
unsigned long *cnt)
|
||||||
{
|
{
|
||||||
unsigned long interval = 0, count = 0;
|
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
|
* Determine if the last argument is an integer or a pool name
|
||||||
|
|
|
@ -2303,7 +2303,7 @@ dbuf_write_ready(zio_t *zio, arc_buf_t *buf, void *vdb)
|
||||||
|
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
if (db->db_blkid == DMU_SPILL_BLKID) {
|
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(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR);
|
||||||
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
|
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
|
||||||
db->db_blkptr == &dn->dn_phys->dn_spill);
|
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
|
#ifdef ZFS_DEBUG
|
||||||
if (db->db_blkid == DMU_SPILL_BLKID) {
|
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(dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR);
|
||||||
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
|
ASSERT(!(BP_IS_HOLE(db->db_blkptr)) &&
|
||||||
db->db_blkptr == &dn->dn_phys->dn_spill);
|
db->db_blkptr == &dn->dn_phys->dn_spill);
|
||||||
|
|
|
@ -1146,8 +1146,8 @@ dmu_sync_ready(zio_t *zio, arc_buf_t *buf, void *varg)
|
||||||
{
|
{
|
||||||
dmu_sync_arg_t *dsa = varg;
|
dmu_sync_arg_t *dsa = varg;
|
||||||
dmu_buf_t *db = dsa->dsa_zgd->zgd_db;
|
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;
|
blkptr_t *bp = zio->io_bp;
|
||||||
|
ASSERTV(dnode_t *dn = ((dmu_buf_impl_t *)db)->db_dnode);
|
||||||
|
|
||||||
if (zio->io_error == 0) {
|
if (zio->io_error == 0) {
|
||||||
if (BP_IS_HOLE(bp)) {
|
if (BP_IS_HOLE(bp)) {
|
||||||
|
|
|
@ -954,7 +954,6 @@ dmu_objset_write_ready(zio_t *zio, arc_buf_t *abuf, void *arg)
|
||||||
blkptr_t *bp = zio->io_bp;
|
blkptr_t *bp = zio->io_bp;
|
||||||
objset_t *os = arg;
|
objset_t *os = arg;
|
||||||
dnode_phys_t *dnp = &os->os_phys->os_meta_dnode;
|
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 == os->os_rootbp);
|
||||||
ASSERT(BP_GET_TYPE(bp) == DMU_OT_OBJSET);
|
ASSERT(BP_GET_TYPE(bp) == DMU_OT_OBJSET);
|
||||||
|
|
|
@ -1466,8 +1466,8 @@ static void
|
||||||
remove_from_next_clones(dsl_dataset_t *ds, uint64_t obj, dmu_tx_t *tx)
|
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;
|
objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
|
||||||
uint64_t count;
|
|
||||||
int err;
|
int err;
|
||||||
|
ASSERTV(uint64_t count);
|
||||||
|
|
||||||
ASSERT(ds->ds_phys->ds_num_children >= 2);
|
ASSERT(ds->ds_phys->ds_num_children >= 2);
|
||||||
err = zap_remove_int(mos, ds->ds_phys->ds_next_clones_obj, obj, tx);
|
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 int snaplist_space(list_t *l, uint64_t mintxg, uint64_t *spacep);
|
||||||
static boolean_t snaplist_unstable(list_t *l);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
dsl_dataset_promote_check(void *arg1, void *arg2, dmu_tx_t *tx)
|
dsl_dataset_promote_check(void *arg1, void *arg2, dmu_tx_t *tx)
|
||||||
|
|
|
@ -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);
|
sa_hdr_phys_t *sa_hdr_phys = SA_GET_HDR(hdl, buftype);
|
||||||
dmu_buf_impl_t *db;
|
dmu_buf_impl_t *db;
|
||||||
sa_os_t *sa = hdl->sa_os->os_sa;
|
|
||||||
int num_lengths = 1;
|
int num_lengths = 1;
|
||||||
int i;
|
int i;
|
||||||
|
ASSERTV(sa_os_t *sa = hdl->sa_os->os_sa);
|
||||||
|
|
||||||
ASSERT(MUTEX_HELD(&sa->sa_lock));
|
ASSERT(MUTEX_HELD(&sa->sa_lock));
|
||||||
if (sa_hdr_phys->sa_magic == SA_MAGIC)
|
if (sa_hdr_phys->sa_magic == SA_MAGIC)
|
||||||
|
@ -1224,7 +1224,7 @@ sa_idx_tab_rele(objset_t *os, void *arg)
|
||||||
static void
|
static void
|
||||||
sa_idx_tab_hold(objset_t *os, sa_idx_tab_t *idx_tab)
|
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));
|
ASSERT(MUTEX_HELD(&sa->sa_lock));
|
||||||
(void) refcount_add(&idx_tab->sa_refcount, NULL);
|
(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)
|
sa_handle_type_t hdl_type, sa_handle_t **handlepp)
|
||||||
{
|
{
|
||||||
int error = 0;
|
int error = 0;
|
||||||
dmu_object_info_t doi;
|
|
||||||
sa_handle_t *handle;
|
sa_handle_t *handle;
|
||||||
|
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
|
dmu_object_info_t doi;
|
||||||
|
|
||||||
dmu_object_info_from_db(db, &doi);
|
dmu_object_info_from_db(db, &doi);
|
||||||
ASSERT(doi.doi_bonus_type == DMU_OT_SA ||
|
ASSERT(doi.doi_bonus_type == DMU_OT_SA ||
|
||||||
doi.doi_bonus_type == DMU_OT_ZNODE);
|
doi.doi_bonus_type == DMU_OT_ZNODE);
|
||||||
|
|
|
@ -1401,8 +1401,8 @@ vdev_validate(vdev_t *vd)
|
||||||
void
|
void
|
||||||
vdev_close(vdev_t *vd)
|
vdev_close(vdev_t *vd)
|
||||||
{
|
{
|
||||||
ASSERTV(spa_t *spa = vd->vdev_spa);
|
|
||||||
vdev_t *pvd = vd->vdev_parent;
|
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);
|
ASSERT(spa_config_held(spa, SCL_STATE_ALL, RW_WRITER) == SCL_STATE_ALL);
|
||||||
|
|
||||||
|
|
|
@ -1043,12 +1043,13 @@ zap_update(objset_t *os, uint64_t zapobj, const char *name,
|
||||||
{
|
{
|
||||||
zap_t *zap;
|
zap_t *zap;
|
||||||
mzap_ent_t *mze;
|
mzap_ent_t *mze;
|
||||||
uint64_t oldval;
|
|
||||||
const uint64_t *intval = val;
|
const uint64_t *intval = val;
|
||||||
zap_name_t *zn;
|
zap_name_t *zn;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
#ifdef ZFS_DEBUG
|
#ifdef ZFS_DEBUG
|
||||||
|
uint64_t oldval;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If there is an old value, it shouldn't change across the
|
* If there is an old value, it shouldn't change across the
|
||||||
* lockdir (eg, due to bprewrite's xlation).
|
* lockdir (eg, due to bprewrite's xlation).
|
||||||
|
|
|
@ -78,8 +78,6 @@ boolean_t zfs_nocacheflush = B_FALSE;
|
||||||
|
|
||||||
static kmem_cache_t *zil_lwb_cache;
|
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) - \
|
#define LWB_EMPTY(lwb) ((BP_GET_LSIZE(&lwb->lwb_blk) - \
|
||||||
sizeof (zil_chain_t)) == (lwb->lwb_sz - lwb->lwb_nused))
|
sizeof (zil_chain_t)) == (lwb->lwb_sz - lwb->lwb_nused))
|
||||||
|
|
||||||
|
|
|
@ -1939,12 +1939,12 @@ static void
|
||||||
zio_ddt_ditto_write_done(zio_t *zio)
|
zio_ddt_ditto_write_done(zio_t *zio)
|
||||||
{
|
{
|
||||||
int p = DDT_PHYS_DITTO;
|
int p = DDT_PHYS_DITTO;
|
||||||
zio_prop_t *zp = &zio->io_prop;
|
|
||||||
blkptr_t *bp = zio->io_bp;
|
blkptr_t *bp = zio->io_bp;
|
||||||
ddt_t *ddt = ddt_select(zio->io_spa, bp);
|
ddt_t *ddt = ddt_select(zio->io_spa, bp);
|
||||||
ddt_entry_t *dde = zio->io_private;
|
ddt_entry_t *dde = zio->io_private;
|
||||||
ddt_phys_t *ddp = &dde->dde_phys[p];
|
ddt_phys_t *ddp = &dde->dde_phys[p];
|
||||||
ddt_key_t *ddk = &dde->dde_key;
|
ddt_key_t *ddk = &dde->dde_key;
|
||||||
|
ASSERTV(zio_prop_t *zp = &zio->io_prop);
|
||||||
|
|
||||||
ddt_enter(ddt);
|
ddt_enter(ddt);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue