diff options
author | Brian Behlendorf <[email protected]> | 2008-12-19 11:05:49 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2008-12-19 11:05:49 -0800 |
commit | cc92d6497b1c853970ff22324d52e48f508f8ffc (patch) | |
tree | 720911d04d161dfdc65b300ae62eed7b8bd0df5d /cmd | |
parent | 1db27e736efa5ecbea5578ded8abe7e84b5ab035 (diff) | |
parent | e8157d65b31898958be0c7f7bc99a32e17fd6389 (diff) |
Merge branch 'gcc-branch' into refs/top-bases/zfs-branch
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/zdb/zdb.c | 14 | ||||
-rw-r--r-- | cmd/ztest/ztest.c | 3 |
2 files changed, 11 insertions, 6 deletions
diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 253a1346a..ee2923e2c 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -1389,10 +1389,11 @@ static void zdb_leak_init(spa_t *spa) { vdev_t *rvd = spa->spa_root_vdev; + int c, m; - for (int c = 0; c < rvd->vdev_children; c++) { + for (c = 0; c < rvd->vdev_children; c++) { vdev_t *vd = rvd->vdev_child[c]; - for (int m = 0; m < vd->vdev_ms_count; m++) { + for (m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); VERIFY(space_map_load(&msp->ms_map, &zdb_space_map_ops, @@ -1407,10 +1408,11 @@ static void zdb_leak_fini(spa_t *spa) { vdev_t *rvd = spa->spa_root_vdev; + int c, m; - for (int c = 0; c < rvd->vdev_children; c++) { + for (c = 0; c < rvd->vdev_children; c++) { vdev_t *vd = rvd->vdev_child[c]; - for (int m = 0; m < vd->vdev_ms_count; m++) { + for (m = 0; m < vd->vdev_ms_count; m++) { metaslab_t *msp = vd->vdev_ms[m]; mutex_enter(&msp->ms_lock); space_map_unload(&msp->ms_map); @@ -1445,7 +1447,9 @@ typedef struct zdb_cb { static void zdb_count_block(spa_t *spa, zdb_cb_t *zcb, blkptr_t *bp, dmu_object_type_t type) { - for (int i = 0; i < 4; i++) { + int i; + + for (i = 0; i < 4; i++) { int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL; int t = (i & 1) ? type : DMU_OT_TOTAL; zdb_blkstats_t *zb = &zcb->zcb_type[l][t]; diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 4aba99126..232f5255c 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -834,11 +834,12 @@ static vdev_t * vdev_lookup_by_path(vdev_t *vd, const char *path) { vdev_t *mvd; + int c; if (vd->vdev_path != NULL && strcmp(path, vd->vdev_path) == 0) return (vd); - for (int c = 0; c < vd->vdev_children; c++) + for (c = 0; c < vd->vdev_children; c++) if ((mvd = vdev_lookup_by_path(vd->vdev_child[c], path)) != NULL) return (mvd); |