diff options
author | Brian Behlendorf <[email protected]> | 2009-08-18 14:18:34 -0700 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2009-08-18 14:18:34 -0700 |
commit | 5d83878f46ecd3c81a693f1caf07acc794251101 (patch) | |
tree | 06737b45dba8e9af9ecf7cce40cf50a28aadfbfa /module/zfs | |
parent | ef0204794a9e4300133aa1bf7810f626423cd13b (diff) | |
parent | 21ccfb65d6279c954a2795dbe2b02c37b0a20d98 (diff) |
Merge branch 'gcc-branch' into refs/top-bases/zfs-branch
Diffstat (limited to 'module/zfs')
-rw-r--r-- | module/zfs/vdev.c | 5 | ||||
-rw-r--r-- | module/zfs/vdev_mirror.c | 7 | ||||
-rw-r--r-- | module/zfs/vdev_raidz.c | 30 | ||||
-rw-r--r-- | module/zfs/vdev_root.c | 7 |
4 files changed, 28 insertions, 21 deletions
diff --git a/module/zfs/vdev.c b/module/zfs/vdev.c index 54e154390..57869b6e6 100644 --- a/module/zfs/vdev.c +++ b/module/zfs/vdev.c @@ -1023,13 +1023,14 @@ vdev_open_children(vdev_t *vd) { taskq_t *tq; int children = vd->vdev_children; + int c; tq = taskq_create("vdev_open", children, minclsyspri, children, children, TASKQ_PREPOPULATE); - for (int c = 0; c < children; c++) + for (c = 0; c < children; c++) VERIFY(taskq_dispatch(tq, vdev_open_child, vd->vdev_child[c], - TQ_SLEEP) != NULL); + TQ_SLEEP) != 0); taskq_destroy(tq); } diff --git a/module/zfs/vdev_mirror.c b/module/zfs/vdev_mirror.c index 58e3a5328..32615c0bc 100644 --- a/module/zfs/vdev_mirror.c +++ b/module/zfs/vdev_mirror.c @@ -126,6 +126,7 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) { int numerrors = 0; int lasterror = 0; + int c; if (vd->vdev_children == 0) { vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; @@ -134,7 +135,7 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) vdev_open_children(vd); - for (int c = 0; c < vd->vdev_children; c++) { + for (c = 0; c < vd->vdev_children; c++) { vdev_t *cvd = vd->vdev_child[c]; if (cvd->vdev_open_error) { @@ -158,7 +159,9 @@ vdev_mirror_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) static void vdev_mirror_close(vdev_t *vd) { - for (int c = 0; c < vd->vdev_children; c++) + int c; + + for (c = 0; c < vd->vdev_children; c++) vdev_close(vd->vdev_child[c]); } diff --git a/module/zfs/vdev_raidz.c b/module/zfs/vdev_raidz.c index 6d6f166ca..c808cf386 100644 --- a/module/zfs/vdev_raidz.c +++ b/module/zfs/vdev_raidz.c @@ -1002,7 +1002,7 @@ vdev_raidz_matrix_reconstruct(raidz_map_t *rm, int n, int nmissing, uint64_t ccount; uint8_t *dst[VDEV_RAIDZ_MAXPARITY]; uint64_t dcount[VDEV_RAIDZ_MAXPARITY]; - uint8_t log, val; + uint8_t log = 0, val; int ll; uint8_t *invlog[VDEV_RAIDZ_MAXPARITY]; uint8_t *p, *pp; @@ -1506,7 +1506,7 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors) void *orig[VDEV_RAIDZ_MAXPARITY]; int tstore[VDEV_RAIDZ_MAXPARITY + 2]; int *tgts = &tstore[1]; - int current, next, i, c, n; + int curr, next, i, c, n; int code, ret = 0; ASSERT(total_errors < rm->rm_firstdatacol); @@ -1554,12 +1554,12 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors) orig[n - 1] = zio_buf_alloc(rm->rm_col[0].rc_size); - current = 0; - next = tgts[current]; + curr = 0; + next = tgts[curr]; - while (current != n) { - tgts[current] = next; - current = 0; + while (curr != n) { + tgts[curr] = next; + curr = 0; /* * Save off the original data that we're going to @@ -1606,34 +1606,34 @@ vdev_raidz_combrec(zio_t *zio, int total_errors, int data_errors) do { /* - * Find the next valid column after the current + * Find the next valid column after the curr * position.. */ - for (next = tgts[current] + 1; + for (next = tgts[curr] + 1; next < rm->rm_cols && rm->rm_col[next].rc_error != 0; next++) continue; - ASSERT(next <= tgts[current + 1]); + ASSERT(next <= tgts[curr + 1]); /* * If that spot is available, we're done here. */ - if (next != tgts[current + 1]) + if (next != tgts[curr + 1]) break; /* * Otherwise, find the next valid column after * the previous position. */ - for (c = tgts[current - 1] + 1; + for (c = tgts[curr - 1] + 1; rm->rm_col[c].rc_error != 0; c++) continue; - tgts[current] = c; - current++; + tgts[curr] = c; + curr++; - } while (current != n); + } while (curr != n); } } n--; diff --git a/module/zfs/vdev_root.c b/module/zfs/vdev_root.c index 524c8e606..dc9c0b984 100644 --- a/module/zfs/vdev_root.c +++ b/module/zfs/vdev_root.c @@ -54,6 +54,7 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) { int lasterror = 0; int numerrors = 0; + int c; if (vd->vdev_children == 0) { vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; @@ -62,7 +63,7 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) vdev_open_children(vd); - for (int c = 0; c < vd->vdev_children; c++) { + for (c = 0; c < vd->vdev_children; c++) { vdev_t *cvd = vd->vdev_child[c]; if (cvd->vdev_open_error && !cvd->vdev_islog) { @@ -85,7 +86,9 @@ vdev_root_open(vdev_t *vd, uint64_t *asize, uint64_t *ashift) static void vdev_root_close(vdev_t *vd) { - for (int c = 0; c < vd->vdev_children; c++) + int c; + + for (c = 0; c < vd->vdev_children; c++) vdev_close(vd->vdev_child[c]); } |