Deleted Added
full compact
zpool_main.c (253441) zpool_main.c (254591)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1281 unchanged lines hidden (view full) ---

1290/*
1291 * Print out configuration state as requested by status_callback.
1292 */
1293void
1294print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
1295 int namewidth, int depth, boolean_t isspare)
1296{
1297 nvlist_t **child;
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 1281 unchanged lines hidden (view full) ---

1290/*
1291 * Print out configuration state as requested by status_callback.
1292 */
1293void
1294print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
1295 int namewidth, int depth, boolean_t isspare)
1296{
1297 nvlist_t **child;
1298 uint_t c, children;
1298 uint_t c, vsc, children;
1299 pool_scan_stat_t *ps = NULL;
1300 vdev_stat_t *vs;
1301 char rbuf[6], wbuf[6], cbuf[6];
1302 char *vname;
1303 uint64_t notpresent;
1299 pool_scan_stat_t *ps = NULL;
1300 vdev_stat_t *vs;
1301 char rbuf[6], wbuf[6], cbuf[6];
1302 char *vname;
1303 uint64_t notpresent;
1304 uint64_t ashift;
1304 spare_cbdata_t cb;
1305 const char *state;
1306
1307 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
1308 &child, &children) != 0)
1309 children = 0;
1310
1311 verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
1305 spare_cbdata_t cb;
1306 const char *state;
1307
1308 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
1309 &child, &children) != 0)
1310 children = 0;
1311
1312 verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
1312 (uint64_t **)&vs, &c) == 0);
1313 (uint64_t **)&vs, &vsc) == 0);
1313
1314 state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
1315 if (isspare) {
1316 /*
1317 * For hot spares, we use the terms 'INUSE' and 'AVAILABLE' for
1318 * online drives.
1319 */
1320 if (vs->vs_aux == VDEV_AUX_SPARED)

--- 37 unchanged lines hidden (view full) ---

1358 case VDEV_AUX_VERSION_NEWER:
1359 (void) printf(gettext("newer version"));
1360 break;
1361
1362 case VDEV_AUX_UNSUP_FEAT:
1363 (void) printf(gettext("unsupported feature(s)"));
1364 break;
1365
1314
1315 state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
1316 if (isspare) {
1317 /*
1318 * For hot spares, we use the terms 'INUSE' and 'AVAILABLE' for
1319 * online drives.
1320 */
1321 if (vs->vs_aux == VDEV_AUX_SPARED)

--- 37 unchanged lines hidden (view full) ---

1359 case VDEV_AUX_VERSION_NEWER:
1360 (void) printf(gettext("newer version"));
1361 break;
1362
1363 case VDEV_AUX_UNSUP_FEAT:
1364 (void) printf(gettext("unsupported feature(s)"));
1365 break;
1366
1367 case VDEV_AUX_ASHIFT_TOO_BIG:
1368 (void) printf(gettext("unsupported minimum blocksize"));
1369 break;
1370
1366 case VDEV_AUX_SPARED:
1367 verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
1368 &cb.cb_guid) == 0);
1369 if (zpool_iter(g_zfs, find_spare, &cb) == 1) {
1370 if (strcmp(zpool_get_name(cb.cb_zhp),
1371 zpool_get_name(zhp)) == 0)
1372 (void) printf(gettext("currently in "
1373 "use"));

--- 26 unchanged lines hidden (view full) ---

1400 case VDEV_AUX_SPLIT_POOL:
1401 (void) printf(gettext("split into new pool"));
1402 break;
1403
1404 default:
1405 (void) printf(gettext("corrupted data"));
1406 break;
1407 }
1371 case VDEV_AUX_SPARED:
1372 verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
1373 &cb.cb_guid) == 0);
1374 if (zpool_iter(g_zfs, find_spare, &cb) == 1) {
1375 if (strcmp(zpool_get_name(cb.cb_zhp),
1376 zpool_get_name(zhp)) == 0)
1377 (void) printf(gettext("currently in "
1378 "use"));

--- 26 unchanged lines hidden (view full) ---

1405 case VDEV_AUX_SPLIT_POOL:
1406 (void) printf(gettext("split into new pool"));
1407 break;
1408
1409 default:
1410 (void) printf(gettext("corrupted data"));
1411 break;
1412 }
1413 } else if (children == 0 && !isspare &&
1414 VDEV_STAT_VALID(vs_physical_ashift, vsc) &&
1415 vs->vs_configured_ashift < vs->vs_physical_ashift) {
1416 (void) printf(
1417 gettext(" block size: %dB configured, %dB native"),
1418 1 << vs->vs_configured_ashift, 1 << vs->vs_physical_ashift);
1408 }
1409
1410 (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
1411 (uint64_t **)&ps, &c);
1412
1413 if (ps && ps->pss_state == DSS_SCANNING &&
1414 vs->vs_scan_processed != 0 && children == 0) {
1415 (void) printf(gettext(" (%s)"),

--- 2847 unchanged lines hidden (view full) ---

4263 "\tWaiting for adminstrator intervention to fix the "
4264 "faulted pool.\n"));
4265 (void) printf(gettext("action: Either restore the affected "
4266 "device(s) and run 'zpool online',\n"
4267 "\tor ignore the intent log records by running "
4268 "'zpool clear'.\n"));
4269 break;
4270
1419 }
1420
1421 (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
1422 (uint64_t **)&ps, &c);
1423
1424 if (ps && ps->pss_state == DSS_SCANNING &&
1425 vs->vs_scan_processed != 0 && children == 0) {
1426 (void) printf(gettext(" (%s)"),

--- 2847 unchanged lines hidden (view full) ---

4274 "\tWaiting for adminstrator intervention to fix the "
4275 "faulted pool.\n"));
4276 (void) printf(gettext("action: Either restore the affected "
4277 "device(s) and run 'zpool online',\n"
4278 "\tor ignore the intent log records by running "
4279 "'zpool clear'.\n"));
4280 break;
4281
4282 case ZPOOL_STATUS_NON_NATIVE_ASHIFT:
4283 (void) printf(gettext("status: One or more devices are "
4284 "configured to use a non-native block size.\n"
4285 "\tExpect reduced performance.\n"));
4286 (void) printf(gettext("action: Replace affected devices with "
4287 "devices that support the\n\tconfigured block size, or "
4288 "migrate data to a properly configured\n\tpool.\n"));
4289 break;
4290
4271 default:
4272 /*
4273 * The remaining errors can't actually be generated, yet.
4274 */
4275 assert(reason == ZPOOL_STATUS_OK);
4276 }
4277
4278 if (msgid != NULL)

--- 1093 unchanged lines hidden ---
4291 default:
4292 /*
4293 * The remaining errors can't actually be generated, yet.
4294 */
4295 assert(reason == ZPOOL_STATUS_OK);
4296 }
4297
4298 if (msgid != NULL)

--- 1093 unchanged lines hidden ---