git://git.camperquake.de
/
zfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix gcc missing parenthesis warnings
[zfs.git]
/
module
/
zfs
/
spa.c
diff --git
a/module/zfs/spa.c
b/module/zfs/spa.c
index
b6190e4
..
b397a19
100644
(file)
--- a/
module/zfs/spa.c
+++ b/
module/zfs/spa.c
@@
-271,8
+271,8
@@
spa_prop_get(spa_t *spa, nvlist_t **nvp)
dp = spa_get_dsl(spa);
rw_enter(&dp->dp_config_rwlock, RW_READER);
dp = spa_get_dsl(spa);
rw_enter(&dp->dp_config_rwlock, RW_READER);
- if (err = dsl_dataset_hold_obj(dp,
- za.za_first_integer, FTAG, &ds)) {
+ if (
(
err = dsl_dataset_hold_obj(dp,
+ za.za_first_integer, FTAG, &ds))
)
{
rw_exit(&dp->dp_config_rwlock);
break;
}
rw_exit(&dp->dp_config_rwlock);
break;
}
@@
-398,7
+398,7
@@
spa_prop_validate(spa_t *spa, nvlist_t *props)
break;
}
break;
}
- if (
error = dmu_objset_hold(strval, FTAG, &os
))
+ if (
(error = dmu_objset_hold(strval,FTAG,&os)
))
break;
/* Must be ZPL and not gzip compressed. */
break;
/* Must be ZPL and not gzip compressed. */
@@
-471,6
+471,9
@@
spa_prop_validate(spa_t *spa, nvlist_t *props)
intval != 0 && intval < ZIO_DEDUPDITTO_MIN)
error = EINVAL;
break;
intval != 0 && intval < ZIO_DEDUPDITTO_MIN)
error = EINVAL;
break;
+
+ default:
+ break;
}
if (error)
}
if (error)
@@
-653,8
+656,10
@@
spa_taskq_create(spa_t *spa, const char *name, enum zti_modes mode,
static void
spa_create_zio_taskqs(spa_t *spa)
{
static void
spa_create_zio_taskqs(spa_t *spa)
{
- for (int t = 0; t < ZIO_TYPES; t++) {
- for (int q = 0; q < ZIO_TASKQ_TYPES; q++) {
+ int t, q;
+
+ for (t = 0; t < ZIO_TYPES; t++) {
+ for (q = 0; q < ZIO_TASKQ_TYPES; q++) {
const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
enum zti_modes mode = ztip->zti_mode;
uint_t value = ztip->zti_value;
const zio_taskq_info_t *ztip = &zio_taskqs[t][q];
enum zti_modes mode = ztip->zti_mode;
uint_t value = ztip->zti_value;
@@
-808,6
+813,8
@@
spa_activate(spa_t *spa, int mode)
static void
spa_deactivate(spa_t *spa)
{
static void
spa_deactivate(spa_t *spa)
{
+ int t, q;
+
ASSERT(spa->spa_sync_on == B_FALSE);
ASSERT(spa->spa_dsl_pool == NULL);
ASSERT(spa->spa_root_vdev == NULL);
ASSERT(spa->spa_sync_on == B_FALSE);
ASSERT(spa->spa_dsl_pool == NULL);
ASSERT(spa->spa_root_vdev == NULL);
@@
-819,8
+826,8
@@
spa_deactivate(spa_t *spa)
list_destroy(&spa->spa_config_dirty_list);
list_destroy(&spa->spa_state_dirty_list);
list_destroy(&spa->spa_config_dirty_list);
list_destroy(&spa->spa_state_dirty_list);
- for (
int
t = 0; t < ZIO_TYPES; t++) {
- for (
int
q = 0; q < ZIO_TASKQ_TYPES; q++) {
+ for (t = 0; t < ZIO_TYPES; t++) {
+ for (q = 0; q < ZIO_TASKQ_TYPES; q++) {
if (spa->spa_zio_taskq[t][q] != NULL)
taskq_destroy(spa->spa_zio_taskq[t][q]);
spa->spa_zio_taskq[t][q] = NULL;
if (spa->spa_zio_taskq[t][q] != NULL)
taskq_destroy(spa->spa_zio_taskq[t][q]);
spa->spa_zio_taskq[t][q] = NULL;
@@
-883,6
+890,7
@@
spa_config_parse(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent,
nvlist_t **child;
uint_t children;
int error;
nvlist_t **child;
uint_t children;
int error;
+ int c;
if ((error = vdev_alloc(spa, vdp, nv, parent, id, atype)) != 0)
return (error);
if ((error = vdev_alloc(spa, vdp, nv, parent, id, atype)) != 0)
return (error);
@@
-902,7
+910,7
@@
spa_config_parse(spa_t *spa, vdev_t **vdp, nvlist_t *nv, vdev_t *parent,
return (EINVAL);
}
return (EINVAL);
}
- for (
int
c = 0; c < children; c++) {
+ for (c = 0; c < children; c++) {
vdev_t *vd;
if ((error = spa_config_parse(spa, &vd, child[c], *vdp, c,
atype)) != 0) {
vdev_t *vd;
if ((error = spa_config_parse(spa, &vd, child[c], *vdp, c,
atype)) != 0) {
@@
-1279,7
+1287,9
@@
load_nvlist(spa_t *spa, uint64_t obj, nvlist_t **value)
static void
spa_check_removed(vdev_t *vd)
{
static void
spa_check_removed(vdev_t *vd)
{
- for (int c = 0; c < vd->vdev_children; c++)
+ int c;
+
+ for (c = 0; c < vd->vdev_children; c++)
spa_check_removed(vd->vdev_child[c]);
if (vd->vdev_ops->vdev_op_leaf && vdev_is_dead(vd)) {
spa_check_removed(vd->vdev_child[c]);
if (vd->vdev_ops->vdev_op_leaf && vdev_is_dead(vd)) {
@@
-1296,6
+1306,7
@@
spa_config_valid(spa_t *spa, nvlist_t *config)
{
vdev_t *mrvd, *rvd = spa->spa_root_vdev;
nvlist_t *nv;
{
vdev_t *mrvd, *rvd = spa->spa_root_vdev;
nvlist_t *nv;
+ int c, i;
VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nv) == 0);
VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &nv) == 0);
@@
-1317,7
+1328,7
@@
spa_config_valid(spa_t *spa, nvlist_t *config)
KM_SLEEP);
VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
KM_SLEEP);
VERIFY(nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) == 0);
- for (
int
c = 0; c < rvd->vdev_children; c++) {
+ for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
vdev_t *mtvd = mrvd->vdev_child[c];
vdev_t *tvd = rvd->vdev_child[c];
vdev_t *mtvd = mrvd->vdev_child[c];
@@
-1334,7
+1345,7
@@
spa_config_valid(spa_t *spa, nvlist_t *config)
VERIFY(nvlist_add_nvlist(spa->spa_load_info,
ZPOOL_CONFIG_MISSING_DEVICES, nv) == 0);
VERIFY(nvlist_add_nvlist(spa->spa_load_info,
ZPOOL_CONFIG_MISSING_DEVICES, nv) == 0);
- for (i
nt i
= 0; i < idx; i++)
+ for (i = 0; i < idx; i++)
nvlist_free(child[i]);
}
nvlist_free(nv);
nvlist_free(child[i]);
}
nvlist_free(nv);
@@
-1346,7
+1357,7
@@
spa_config_valid(spa_t *spa, nvlist_t *config)
* from the MOS config (mrvd). Check each top-level vdev
* with the corresponding MOS config top-level (mtvd).
*/
* from the MOS config (mrvd). Check each top-level vdev
* with the corresponding MOS config top-level (mtvd).
*/
- for (
int
c = 0; c < rvd->vdev_children; c++) {
+ for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
vdev_t *mtvd = mrvd->vdev_child[c];
vdev_t *tvd = rvd->vdev_child[c];
vdev_t *mtvd = mrvd->vdev_child[c];
@@
-1417,6
+1428,8
@@
static int
spa_check_logs(spa_t *spa)
{
switch (spa->spa_log_state) {
spa_check_logs(spa_t *spa)
{
switch (spa->spa_log_state) {
+ default:
+ break;
case SPA_LOG_MISSING:
/* need to recheck in case slog has been restored */
case SPA_LOG_UNKNOWN:
case SPA_LOG_MISSING:
/* need to recheck in case slog has been restored */
case SPA_LOG_UNKNOWN:
@@
-1435,13
+1448,14
@@
spa_passivate_log(spa_t *spa)
{
vdev_t *rvd = spa->spa_root_vdev;
boolean_t slog_found = B_FALSE;
{
vdev_t *rvd = spa->spa_root_vdev;
boolean_t slog_found = B_FALSE;
+ int c;
ASSERT(spa_config_held(spa, SCL_ALLOC, RW_WRITER));
if (!spa_has_slogs(spa))
return (B_FALSE);
ASSERT(spa_config_held(spa, SCL_ALLOC, RW_WRITER));
if (!spa_has_slogs(spa))
return (B_FALSE);
- for (
int
c = 0; c < rvd->vdev_children; c++) {
+ for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
metaslab_group_t *mg = tvd->vdev_mg;
vdev_t *tvd = rvd->vdev_child[c];
metaslab_group_t *mg = tvd->vdev_mg;
@@
-1458,10
+1472,11
@@
static void
spa_activate_log(spa_t *spa)
{
vdev_t *rvd = spa->spa_root_vdev;
spa_activate_log(spa_t *spa)
{
vdev_t *rvd = spa->spa_root_vdev;
+ int c;
ASSERT(spa_config_held(spa, SCL_ALLOC, RW_WRITER));
ASSERT(spa_config_held(spa, SCL_ALLOC, RW_WRITER));
- for (
int
c = 0; c < rvd->vdev_children; c++) {
+ for (c = 0; c < rvd->vdev_children; c++) {
vdev_t *tvd = rvd->vdev_child[c];
metaslab_group_t *mg = tvd->vdev_mg;
vdev_t *tvd = rvd->vdev_child[c];
metaslab_group_t *mg = tvd->vdev_mg;
@@
-1491,7
+1506,9
@@
spa_offline_log(spa_t *spa)
static void
spa_aux_check_removed(spa_aux_vdev_t *sav)
{
static void
spa_aux_check_removed(spa_aux_vdev_t *sav)
{
- for (int i = 0; i < sav->sav_count; i++)
+ int i;
+
+ for (i = 0; i < sav->sav_count; i++)
spa_check_removed(sav->sav_vdevs[i]);
}
spa_check_removed(sav->sav_vdevs[i]);
}
@@
-2154,7
+2171,7
@@
spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
* to start pushing transactions.
*/
if (state != SPA_LOAD_TRYIMPORT) {
* to start pushing transactions.
*/
if (state != SPA_LOAD_TRYIMPORT) {
- if (
error = spa_load_verify(spa
))
+ if (
(error = spa_load_verify(spa)
))
return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA,
error));
}
return (spa_vdev_err(rvd, VDEV_AUX_CORRUPT_DATA,
error));
}
@@
-2163,6
+2180,7
@@
spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
spa->spa_load_max_txg == UINT64_MAX)) {
dmu_tx_t *tx;
int need_update = B_FALSE;
spa->spa_load_max_txg == UINT64_MAX)) {
dmu_tx_t *tx;
int need_update = B_FALSE;
+ int c;
ASSERT(state != SPA_LOAD_TRYIMPORT);
ASSERT(state != SPA_LOAD_TRYIMPORT);
@@
-2209,7
+2227,7
@@
spa_load_impl(spa_t *spa, uint64_t pool_guid, nvlist_t *config,
(spa->spa_import_flags & ZFS_IMPORT_VERBATIM))
need_update = B_TRUE;
(spa->spa_import_flags & ZFS_IMPORT_VERBATIM))
need_update = B_TRUE;
- for (
int
c = 0; c < rvd->vdev_children; c++)
+ for (c = 0; c < rvd->vdev_children; c++)
if (rvd->vdev_child[c]->vdev_ms_array == 0)
need_update = B_TRUE;
if (rvd->vdev_child[c]->vdev_ms_array == 0)
need_update = B_TRUE;
@@
-2845,6
+2863,7
@@
spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
nvlist_t **spares, **l2cache;
uint_t nspares, nl2cache;
uint64_t version, obj;
nvlist_t **spares, **l2cache;
uint_t nspares, nl2cache;
uint64_t version, obj;
+ int c;
/*
* If this pool already exists, return failure.
/*
* If this pool already exists, return failure.
@@
-2903,7
+2922,7
@@
spa_create(const char *pool, nvlist_t *nvroot, nvlist_t *props,
(error = vdev_create(rvd, txg, B_FALSE)) == 0 &&
(error = spa_validate_aux(spa, nvroot, txg,
VDEV_ALLOC_ADD)) == 0) {
(error = vdev_create(rvd, txg, B_FALSE)) == 0 &&
(error = spa_validate_aux(spa, nvroot, txg,
VDEV_ALLOC_ADD)) == 0) {
- for (
int
c = 0; c < rvd->vdev_children; c++) {
+ for (c = 0; c < rvd->vdev_children; c++) {
vdev_metaslab_set_size(rvd->vdev_child[c]);
vdev_expand(rvd->vdev_child[c], txg);
}
vdev_metaslab_set_size(rvd->vdev_child[c]);
vdev_expand(rvd->vdev_child[c], txg);
}
@@
-3103,7
+3122,9
@@
spa_generate_rootconf(char *devpath, char *devid, uint64_t *guid)
static void
spa_alt_rootvdev(vdev_t *vd, vdev_t **avd, uint64_t *txg)
{
static void
spa_alt_rootvdev(vdev_t *vd, vdev_t **avd, uint64_t *txg)
{
- for (int c = 0; c < vd->vdev_children; c++)
+ int c;
+
+ for (c = 0; c < vd->vdev_children; c++)
spa_alt_rootvdev(vd->vdev_child[c], avd, txg);
if (vd->vdev_ops->vdev_op_leaf) {
spa_alt_rootvdev(vd->vdev_child[c], avd, txg);
if (vd->vdev_ops->vdev_op_leaf) {
@@
-3687,6
+3708,7
@@
spa_vdev_add(spa_t *spa, nvlist_t *nvroot)
vdev_t *vd, *tvd;
nvlist_t **spares, **l2cache;
uint_t nspares, nl2cache;
vdev_t *vd, *tvd;
nvlist_t **spares, **l2cache;
uint_t nspares, nl2cache;
+ int c;
ASSERT(spa_writeable(spa));
ASSERT(spa_writeable(spa));
@@
-3723,7
+3745,7
@@
spa_vdev_add(spa_t *spa, nvlist_t *nvroot)
/*
* Transfer each new top-level vdev from vd to rvd.
*/
/*
* Transfer each new top-level vdev from vd to rvd.
*/
- for (
int
c = 0; c < vd->vdev_children; c++) {
+ for (c = 0; c < vd->vdev_children; c++) {
/*
* Set the vdev id to the first hole, if one exists.
/*
* Set the vdev id to the first hole, if one exists.
@@
-3999,6
+4021,7
@@
spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
boolean_t unspare = B_FALSE;
uint64_t unspare_guid;
char *vdpath;
boolean_t unspare = B_FALSE;
uint64_t unspare_guid;
char *vdpath;
+ int c, t;
ASSERT(spa_writeable(spa));
ASSERT(spa_writeable(spa));
@@
-4066,7
+4089,7
@@
spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
vd->vdev_path != NULL) {
size_t len = strlen(vd->vdev_path);
vd->vdev_path != NULL) {
size_t len = strlen(vd->vdev_path);
- for (
int
c = 0; c < pvd->vdev_children; c++) {
+ for (c = 0; c < pvd->vdev_children; c++) {
cvd = pvd->vdev_child[c];
if (cvd == vd || cvd->vdev_path == NULL)
cvd = pvd->vdev_child[c];
if (cvd == vd || cvd->vdev_path == NULL)
@@
-4174,7
+4197,7
@@
spa_vdev_detach(spa_t *spa, uint64_t guid, uint64_t pguid, int replace_done)
* prevent vd from being accessed after it's freed.
*/
vdpath = spa_strdup(vd->vdev_path);
* prevent vd from being accessed after it's freed.
*/
vdpath = spa_strdup(vd->vdev_path);
- for (
int
t = 0; t < TXG_SIZE; t++)
+ for (t = 0; t < TXG_SIZE; t++)
(void) txg_list_remove_this(&tvd->vdev_dtl_list, vd, t);
vd->vdev_detached = B_TRUE;
vdev_dirty(tvd, VDD_DTL, vd, txg);
(void) txg_list_remove_this(&tvd->vdev_dtl_list, vd, t);
vd->vdev_detached = B_TRUE;
vdev_dirty(tvd, VDD_DTL, vd, txg);
@@
-4509,7
+4532,9
@@
out:
static nvlist_t *
spa_nvlist_lookup_by_guid(nvlist_t **nvpp, int count, uint64_t target_guid)
{
static nvlist_t *
spa_nvlist_lookup_by_guid(nvlist_t **nvpp, int count, uint64_t target_guid)
{
- for (int i = 0; i < count; i++) {
+ int i;
+
+ for (i = 0; i < count; i++) {
uint64_t guid;
VERIFY(nvlist_lookup_uint64(nvpp[i], ZPOOL_CONFIG_GUID,
uint64_t guid;
VERIFY(nvlist_lookup_uint64(nvpp[i], ZPOOL_CONFIG_GUID,
@@
-4527,11
+4552,12
@@
spa_vdev_remove_aux(nvlist_t *config, char *name, nvlist_t **dev, int count,
nvlist_t *dev_to_remove)
{
nvlist_t **newdev = NULL;
nvlist_t *dev_to_remove)
{
nvlist_t **newdev = NULL;
+ int i, j;
if (count > 1)
newdev = kmem_alloc((count - 1) * sizeof (void *), KM_SLEEP);
if (count > 1)
newdev = kmem_alloc((count - 1) * sizeof (void *), KM_SLEEP);
- for (i
nt i
= 0, j = 0; i < count; i++) {
+ for (i = 0, j = 0; i < count; i++) {
if (dev[i] == dev_to_remove)
continue;
VERIFY(nvlist_dup(dev[i], &newdev[j++], KM_SLEEP) == 0);
if (dev[i] == dev_to_remove)
continue;
VERIFY(nvlist_dup(dev[i], &newdev[j++], KM_SLEEP) == 0);
@@
-4540,7
+4566,7
@@
spa_vdev_remove_aux(nvlist_t *config, char *name, nvlist_t **dev, int count,
VERIFY(nvlist_remove(config, name, DATA_TYPE_NVLIST_ARRAY) == 0);
VERIFY(nvlist_add_nvlist_array(config, name, newdev, count - 1) == 0);
VERIFY(nvlist_remove(config, name, DATA_TYPE_NVLIST_ARRAY) == 0);
VERIFY(nvlist_add_nvlist_array(config, name, newdev, count - 1) == 0);
- for (i
nt i
= 0; i < count - 1; i++)
+ for (i = 0; i < count - 1; i++)
nvlist_free(newdev[i]);
if (count > 1)
nvlist_free(newdev[i]);
if (count > 1)
@@
-4761,8
+4787,9
@@
static vdev_t *
spa_vdev_resilver_done_hunt(vdev_t *vd)
{
vdev_t *newvd, *oldvd;
spa_vdev_resilver_done_hunt(vdev_t *vd)
{
vdev_t *newvd, *oldvd;
+ int c;
- for (
int
c = 0; c < vd->vdev_children; c++) {
+ for (c = 0; c < vd->vdev_children; c++) {
oldvd = spa_vdev_resilver_done_hunt(vd->vdev_child[c]);
if (oldvd != NULL)
return (oldvd);
oldvd = spa_vdev_resilver_done_hunt(vd->vdev_child[c]);
if (oldvd != NULL)
return (oldvd);
@@
-4965,6
+4992,8
@@
spa_scan(spa_t *spa, pool_scan_func_t func)
static void
spa_async_remove(spa_t *spa, vdev_t *vd)
{
static void
spa_async_remove(spa_t *spa, vdev_t *vd)
{
+ int c;
+
if (vd->vdev_remove_wanted) {
vd->vdev_remove_wanted = B_FALSE;
vd->vdev_delayed_close = B_FALSE;
if (vd->vdev_remove_wanted) {
vd->vdev_remove_wanted = B_FALSE;
vd->vdev_delayed_close = B_FALSE;
@@
-4983,19
+5012,21
@@
spa_async_remove(spa_t *spa, vdev_t *vd)
vdev_state_dirty(vd->vdev_top);
}
vdev_state_dirty(vd->vdev_top);
}
- for (
int
c = 0; c < vd->vdev_children; c++)
+ for (c = 0; c < vd->vdev_children; c++)
spa_async_remove(spa, vd->vdev_child[c]);
}
static void
spa_async_probe(spa_t *spa, vdev_t *vd)
{
spa_async_remove(spa, vd->vdev_child[c]);
}
static void
spa_async_probe(spa_t *spa, vdev_t *vd)
{
+ int c;
+
if (vd->vdev_probe_wanted) {
vd->vdev_probe_wanted = B_FALSE;
vdev_reopen(vd); /* vdev_open() does the actual probe */
}
if (vd->vdev_probe_wanted) {
vd->vdev_probe_wanted = B_FALSE;
vdev_reopen(vd); /* vdev_open() does the actual probe */
}
- for (
int
c = 0; c < vd->vdev_children; c++)
+ for (c = 0; c < vd->vdev_children; c++)
spa_async_probe(spa, vd->vdev_child[c]);
}
spa_async_probe(spa, vd->vdev_child[c]);
}
@@
-5005,11
+5036,12
@@
spa_async_autoexpand(spa_t *spa, vdev_t *vd)
sysevent_id_t eid;
nvlist_t *attr;
char *physpath;
sysevent_id_t eid;
nvlist_t *attr;
char *physpath;
+ int c;
if (!spa->spa_autoexpand)
return;
if (!spa->spa_autoexpand)
return;
- for (
int
c = 0; c < vd->vdev_children; c++) {
+ for (c = 0; c < vd->vdev_children; c++) {
vdev_t *cvd = vd->vdev_child[c];
spa_async_autoexpand(spa, cvd);
}
vdev_t *cvd = vd->vdev_child[c];
spa_async_autoexpand(spa, cvd);
}
@@
-5033,7
+5065,7
@@
spa_async_autoexpand(spa_t *spa, vdev_t *vd)
static void
spa_async_thread(spa_t *spa)
{
static void
spa_async_thread(spa_t *spa)
{
- int tasks;
+ int tasks
, i
;
ASSERT(spa->spa_sync_on);
ASSERT(spa->spa_sync_on);
@@
-5072,9
+5104,9
@@
spa_async_thread(spa_t *spa)
if (tasks & SPA_ASYNC_REMOVE) {
spa_vdev_state_enter(spa, SCL_NONE);
spa_async_remove(spa, spa->spa_root_vdev);
if (tasks & SPA_ASYNC_REMOVE) {
spa_vdev_state_enter(spa, SCL_NONE);
spa_async_remove(spa, spa->spa_root_vdev);
- for (i
nt i
= 0; i < spa->spa_l2cache.sav_count; i++)
+ for (i = 0; i < spa->spa_l2cache.sav_count; i++)
spa_async_remove(spa, spa->spa_l2cache.sav_vdevs[i]);
spa_async_remove(spa, spa->spa_l2cache.sav_vdevs[i]);
- for (i
nt i
= 0; i < spa->spa_spares.sav_count; i++)
+ for (i = 0; i < spa->spa_spares.sav_count; i++)
spa_async_remove(spa, spa->spa_spares.sav_vdevs[i]);
(void) spa_vdev_state_exit(spa, NULL, 0);
}
spa_async_remove(spa, spa->spa_spares.sav_vdevs[i]);
(void) spa_vdev_state_exit(spa, NULL, 0);
}
@@
-5460,6
+5492,7
@@
spa_sync(spa_t *spa, uint64_t txg)
vdev_t *vd;
dmu_tx_t *tx;
int error;
vdev_t *vd;
dmu_tx_t *tx;
int error;
+ int c;
VERIFY(spa_writeable(spa));
VERIFY(spa_writeable(spa));
@@
-5563,7
+5596,7
@@
spa_sync(spa_t *spa, uint64_t txg)
ddt_sync(spa, txg);
dsl_scan_sync(dp, tx);
ddt_sync(spa, txg);
dsl_scan_sync(dp, tx);
- while (
vd = txg_list_remove(&spa->spa_vdev_txg_list, txg
))
+ while (
(vd = txg_list_remove(&spa->spa_vdev_txg_list, txg)
))
vdev_sync(vd, txg);
if (pass == 1)
vdev_sync(vd, txg);
if (pass == 1)
@@
-5593,7
+5626,7
@@
spa_sync(spa_t *spa, uint64_t txg)
int children = rvd->vdev_children;
int c0 = spa_get_random(children);
int children = rvd->vdev_children;
int c0 = spa_get_random(children);
- for (
int
c = 0; c < children; c++) {
+ for (c = 0; c < children; c++) {
vd = rvd->vdev_child[(c0 + c) % children];
if (vd->vdev_ms_array == 0 || vd->vdev_islog)
continue;
vd = rvd->vdev_child[(c0 + c) % children];
if (vd->vdev_ms_array == 0 || vd->vdev_islog)
continue;
@@
-5645,7
+5678,7
@@
spa_sync(spa_t *spa, uint64_t txg)
/*
* Update usable space statistics.
*/
/*
* Update usable space statistics.
*/
- while (
vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg
)))
+ while (
(vd = txg_list_remove(&spa->spa_vdev_txg_list, TXG_CLEAN(txg)
)))
vdev_sync_done(vd, txg);
spa_update_dspace(spa);
vdev_sync_done(vd, txg);
spa_update_dspace(spa);