Fix gcc c90 compliance warnings

Fix non-c90 compliant code, for the most part these changes
simply deal with where a particular variable is declared.
Under c90 it must alway be done at the very start of a block.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
This commit is contained in:
Brian Behlendorf
2010-08-26 09:52:39 -07:00
parent c5b3a7bbcc
commit d6320ddb78
31 changed files with 475 additions and 262 deletions
+8 -5
View File
@@ -1076,6 +1076,7 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_tx_t *tx)
dsl_pool_t *dp = scn->scn_dp;
dsl_dataset_t *ds;
objset_t *os;
char *dsname;
VERIFY3U(0, ==, dsl_dataset_hold_obj(dp, dsobj, FTAG, &ds));
@@ -1098,7 +1099,7 @@ dsl_scan_visitds(dsl_scan_t *scn, uint64_t dsobj, dmu_tx_t *tx)
dmu_buf_will_dirty(ds->ds_dbuf, tx);
dsl_scan_visit_rootbp(scn, ds, &ds->ds_phys->ds_bp, tx);
char *dsname = kmem_alloc(ZFS_MAXNAMELEN, KM_SLEEP);
dsname = kmem_alloc(ZFS_MAXNAMELEN, KM_SLEEP);
dsl_dataset_name(ds, dsname);
zfs_dbgmsg("scanned dataset %llu (%s) with min=%llu max=%llu; "
"pausing=%u",
@@ -1294,11 +1295,12 @@ dsl_scan_ddt_entry(dsl_scan_t *scn, enum zio_checksum checksum,
ddt_phys_t *ddp = dde->dde_phys;
blkptr_t bp;
zbookmark_t zb = { 0 };
int p;
if (scn->scn_phys.scn_state != DSS_SCANNING)
return;
for (int p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
if (ddp->ddp_phys_birth == 0 ||
ddp->ddp_phys_birth > scn->scn_phys.scn_cur_max_txg)
continue;
@@ -1658,10 +1660,11 @@ dsl_scan_scrub_cb(dsl_pool_t *dp,
size_t size = BP_GET_PSIZE(bp);
spa_t *spa = dp->dp_spa;
uint64_t phys_birth = BP_PHYSICAL_BIRTH(bp);
boolean_t needs_io;
boolean_t needs_io = B_FALSE;
int zio_flags = ZIO_FLAG_SCAN_THREAD | ZIO_FLAG_RAW | ZIO_FLAG_CANFAIL;
int zio_priority;
int zio_priority = 0;
int scan_delay = 0;
int d;
if (phys_birth <= scn->scn_phys.scn_min_txg ||
phys_birth >= scn->scn_phys.scn_max_txg)
@@ -1686,7 +1689,7 @@ dsl_scan_scrub_cb(dsl_pool_t *dp,
if (zb->zb_level == ZB_ZIL_LEVEL)
zio_flags |= ZIO_FLAG_SPECULATIVE;
for (int d = 0; d < BP_GET_NDVAS(bp); d++) {
for (d = 0; d < BP_GET_NDVAS(bp); d++) {
vdev_t *vd = vdev_lookup_top(spa,
DVA_GET_VDEV(&bp->blk_dva[d]));