Deleted Added
full compact
zpool_main.c (212067) zpool_main.c (213197)
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

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

975 max)) > max)
976 max = ret;
977 }
978
979
980 return (max);
981}
982
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

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

975 max)) > max)
976 max = ret;
977 }
978
979
980 return (max);
981}
982
983typedef struct spare_cbdata {
984 uint64_t cb_guid;
985 zpool_handle_t *cb_zhp;
986} spare_cbdata_t;
983
987
988static boolean_t
989find_vdev(nvlist_t *nv, uint64_t search)
990{
991 uint64_t guid;
992 nvlist_t **child;
993 uint_t c, children;
994
995 if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &guid) == 0 &&
996 search == guid)
997 return (B_TRUE);
998
999 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
1000 &child, &children) == 0) {
1001 for (c = 0; c < children; c++)
1002 if (find_vdev(child[c], search))
1003 return (B_TRUE);
1004 }
1005
1006 return (B_FALSE);
1007}
1008
1009static int
1010find_spare(zpool_handle_t *zhp, void *data)
1011{
1012 spare_cbdata_t *cbp = data;
1013 nvlist_t *config, *nvroot;
1014
1015 config = zpool_get_config(zhp, NULL);
1016 verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
1017 &nvroot) == 0);
1018
1019 if (find_vdev(nvroot, cbp->cb_guid)) {
1020 cbp->cb_zhp = zhp;
1021 return (1);
1022 }
1023
1024 zpool_close(zhp);
1025 return (0);
1026}
1027
984/*
1028/*
1029 * Print out configuration state as requested by status_callback.
1030 */
1031void
1032print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
1033 int namewidth, int depth, boolean_t isspare)
1034{
1035 nvlist_t **child;
1036 uint_t c, children;
1037 vdev_stat_t *vs;
1038 char rbuf[6], wbuf[6], cbuf[6], repaired[7];
1039 char *vname;
1040 uint64_t notpresent;
1041 spare_cbdata_t cb;
1042 char *state;
1043
1044 verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_STATS,
1045 (uint64_t **)&vs, &c) == 0);
1046
1047 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
1048 &child, &children) != 0)
1049 children = 0;
1050
1051 state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
1052 if (isspare) {
1053 /*
1054 * For hot spares, we use the terms 'INUSE' and 'AVAILABLE' for
1055 * online drives.
1056 */
1057 if (vs->vs_aux == VDEV_AUX_SPARED)
1058 state = "INUSE";
1059 else if (vs->vs_state == VDEV_STATE_HEALTHY)
1060 state = "AVAIL";
1061 }
1062
1063 (void) printf("\t%*s%-*s %-8s", depth, "", namewidth - depth,
1064 name, state);
1065
1066 if (!isspare) {
1067 zfs_nicenum(vs->vs_read_errors, rbuf, sizeof (rbuf));
1068 zfs_nicenum(vs->vs_write_errors, wbuf, sizeof (wbuf));
1069 zfs_nicenum(vs->vs_checksum_errors, cbuf, sizeof (cbuf));
1070 (void) printf(" %5s %5s %5s", rbuf, wbuf, cbuf);
1071 }
1072
1073 if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
1074 &notpresent) == 0) {
1075 char *path;
1076 verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0);
1077 (void) printf(" was %s", path);
1078 } else if (vs->vs_aux != 0) {
1079 (void) printf(" ");
1080
1081 switch (vs->vs_aux) {
1082 case VDEV_AUX_OPEN_FAILED:
1083 (void) printf(gettext("cannot open"));
1084 break;
1085
1086 case VDEV_AUX_BAD_GUID_SUM:
1087 (void) printf(gettext("missing device"));
1088 break;
1089
1090 case VDEV_AUX_NO_REPLICAS:
1091 (void) printf(gettext("insufficient replicas"));
1092 break;
1093
1094 case VDEV_AUX_VERSION_NEWER:
1095 (void) printf(gettext("newer version"));
1096 break;
1097
1098 case VDEV_AUX_SPARED:
1099 verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
1100 &cb.cb_guid) == 0);
1101 if (zpool_iter(g_zfs, find_spare, &cb) == 1) {
1102 if (strcmp(zpool_get_name(cb.cb_zhp),
1103 zpool_get_name(zhp)) == 0)
1104 (void) printf(gettext("currently in "
1105 "use"));
1106 else
1107 (void) printf(gettext("in use by "
1108 "pool '%s'"),
1109 zpool_get_name(cb.cb_zhp));
1110 zpool_close(cb.cb_zhp);
1111 } else {
1112 (void) printf(gettext("currently in use"));
1113 }
1114 break;
1115
1116 case VDEV_AUX_ERR_EXCEEDED:
1117 (void) printf(gettext("too many errors"));
1118 break;
1119
1120 case VDEV_AUX_IO_FAILURE:
1121 (void) printf(gettext("experienced I/O failures"));
1122 break;
1123
1124 case VDEV_AUX_BAD_LOG:
1125 (void) printf(gettext("bad intent log"));
1126 break;
1127
1128 default:
1129 (void) printf(gettext("corrupted data"));
1130 break;
1131 }
1132 } else if (vs->vs_scrub_repaired != 0 && children == 0) {
1133 /*
1134 * Report bytes resilvered/repaired on leaf devices.
1135 */
1136 zfs_nicenum(vs->vs_scrub_repaired, repaired, sizeof (repaired));
1137 (void) printf(gettext(" %s %s"), repaired,
1138 (vs->vs_scrub_type == POOL_SCRUB_RESILVER) ?
1139 "resilvered" : "repaired");
1140 }
1141
1142 (void) printf("\n");
1143
1144 for (c = 0; c < children; c++) {
1145 uint64_t is_log = B_FALSE;
1146
1147 /* Don't print logs here */
1148 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
1149 &is_log);
1150 if (is_log)
1151 continue;
1152 vname = zpool_vdev_name(g_zfs, zhp, child[c]);
1153 print_status_config(zhp, vname, child[c],
1154 namewidth, depth + 2, isspare);
1155 free(vname);
1156 }
1157}
1158
1159
1160/*
985 * Print the configuration of an exported pool. Iterate over all vdevs in the
986 * pool, printing out the name and status for each one.
987 */
988void
1161 * Print the configuration of an exported pool. Iterate over all vdevs in the
1162 * pool, printing out the name and status for each one.
1163 */
1164void
989print_import_config(const char *name, nvlist_t *nv, int namewidth, int depth,
990 boolean_t print_logs)
1165print_import_config(const char *name, nvlist_t *nv, int namewidth, int depth)
991{
992 nvlist_t **child;
993 uint_t c, children;
994 vdev_stat_t *vs;
995 char *type, *vname;
996
997 verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
998 if (strcmp(type, VDEV_TYPE_MISSING) == 0)

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

1039 &child, &children) != 0)
1040 return;
1041
1042 for (c = 0; c < children; c++) {
1043 uint64_t is_log = B_FALSE;
1044
1045 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
1046 &is_log);
1166{
1167 nvlist_t **child;
1168 uint_t c, children;
1169 vdev_stat_t *vs;
1170 char *type, *vname;
1171
1172 verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
1173 if (strcmp(type, VDEV_TYPE_MISSING) == 0)

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

1214 &child, &children) != 0)
1215 return;
1216
1217 for (c = 0; c < children; c++) {
1218 uint64_t is_log = B_FALSE;
1219
1220 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
1221 &is_log);
1047 if ((is_log && !print_logs) || (!is_log && print_logs))
1222 if (is_log)
1048 continue;
1049
1050 vname = zpool_vdev_name(g_zfs, NULL, child[c]);
1223 continue;
1224
1225 vname = zpool_vdev_name(g_zfs, NULL, child[c]);
1051 print_import_config(vname, child[c],
1052 namewidth, depth + 2, B_FALSE);
1226 print_import_config(vname, child[c], namewidth, depth + 2);
1053 free(vname);
1054 }
1055
1056 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
1057 &child, &children) == 0) {
1058 (void) printf(gettext("\tcache\n"));
1059 for (c = 0; c < children; c++) {
1060 vname = zpool_vdev_name(g_zfs, NULL, child[c]);

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

1070 vname = zpool_vdev_name(g_zfs, NULL, child[c]);
1071 (void) printf("\t %s\n", vname);
1072 free(vname);
1073 }
1074 }
1075}
1076
1077/*
1227 free(vname);
1228 }
1229
1230 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
1231 &child, &children) == 0) {
1232 (void) printf(gettext("\tcache\n"));
1233 for (c = 0; c < children; c++) {
1234 vname = zpool_vdev_name(g_zfs, NULL, child[c]);

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

1244 vname = zpool_vdev_name(g_zfs, NULL, child[c]);
1245 (void) printf("\t %s\n", vname);
1246 free(vname);
1247 }
1248 }
1249}
1250
1251/*
1252 * Print log vdevs.
1253 * Logs are recorded as top level vdevs in the main pool child array
1254 * but with "is_log" set to 1. We use either print_status_config() or
1255 * print_import_config() to print the top level logs then any log
1256 * children (eg mirrored slogs) are printed recursively - which
1257 * works because only the top level vdev is marked "is_log"
1258 */
1259static void
1260print_logs(zpool_handle_t *zhp, nvlist_t *nv, int namewidth, boolean_t verbose)
1261{
1262 uint_t c, children;
1263 nvlist_t **child;
1264
1265 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, &child,
1266 &children) != 0)
1267 return;
1268
1269 (void) printf(gettext("\tlogs\n"));
1270
1271 for (c = 0; c < children; c++) {
1272 uint64_t is_log = B_FALSE;
1273 char *name;
1274
1275 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
1276 &is_log);
1277 if (!is_log)
1278 continue;
1279 name = zpool_vdev_name(g_zfs, zhp, child[c]);
1280 if (verbose)
1281 print_status_config(zhp, name, child[c], namewidth,
1282 2, B_FALSE);
1283 else
1284 print_import_config(name, child[c], namewidth, 2);
1285 free(name);
1286 }
1287}
1288/*
1078 * Display the status for the given pool.
1079 */
1080static void
1081show_import(nvlist_t *config)
1082{
1083 uint64_t pool_state;
1084 vdev_stat_t *vs;
1085 char *name;

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

1237 msgid);
1238
1239 (void) printf(gettext("config:\n\n"));
1240
1241 namewidth = max_width(NULL, nvroot, 0, 0);
1242 if (namewidth < 10)
1243 namewidth = 10;
1244
1289 * Display the status for the given pool.
1290 */
1291static void
1292show_import(nvlist_t *config)
1293{
1294 uint64_t pool_state;
1295 vdev_stat_t *vs;
1296 char *name;

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

1448 msgid);
1449
1450 (void) printf(gettext("config:\n\n"));
1451
1452 namewidth = max_width(NULL, nvroot, 0, 0);
1453 if (namewidth < 10)
1454 namewidth = 10;
1455
1245 print_import_config(name, nvroot, namewidth, 0, B_FALSE);
1246 if (num_logs(nvroot) > 0) {
1247 (void) printf(gettext("\tlogs\n"));
1248 print_import_config(name, nvroot, namewidth, 0, B_TRUE);
1249 }
1456 print_import_config(name, nvroot, namewidth, 0);
1457 if (num_logs(nvroot) > 0)
1458 print_logs(NULL, nvroot, namewidth, B_FALSE);
1250
1251 if (reason == ZPOOL_STATUS_BAD_GUID_SUM) {
1252 (void) printf(gettext("\n\tAdditional devices are known to "
1253 "be part of this pool, though their\n\texact "
1254 "configuration cannot be determined.\n"));
1255 }
1256}
1257

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

2712
2713 (void) printf(gettext("%s in progress for %lluh%um, %.2f%% done, "
2714 "%lluh%um to go\n"),
2715 scrub_type, (u_longlong_t)(minutes_taken / 60),
2716 (uint_t)(minutes_taken % 60), 100 * fraction_done,
2717 (u_longlong_t)(minutes_left / 60), (uint_t)(minutes_left % 60));
2718}
2719
1459
1460 if (reason == ZPOOL_STATUS_BAD_GUID_SUM) {
1461 (void) printf(gettext("\n\tAdditional devices are known to "
1462 "be part of this pool, though their\n\texact "
1463 "configuration cannot be determined.\n"));
1464 }
1465}
1466

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

2921
2922 (void) printf(gettext("%s in progress for %lluh%um, %.2f%% done, "
2923 "%lluh%um to go\n"),
2924 scrub_type, (u_longlong_t)(minutes_taken / 60),
2925 (uint_t)(minutes_taken % 60), 100 * fraction_done,
2926 (u_longlong_t)(minutes_left / 60), (uint_t)(minutes_left % 60));
2927}
2928
2720typedef struct spare_cbdata {
2721 uint64_t cb_guid;
2722 zpool_handle_t *cb_zhp;
2723} spare_cbdata_t;
2724
2725static boolean_t
2726find_vdev(nvlist_t *nv, uint64_t search)
2727{
2728 uint64_t guid;
2729 nvlist_t **child;
2730 uint_t c, children;
2731
2732 if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &guid) == 0 &&
2733 search == guid)
2734 return (B_TRUE);
2735
2736 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
2737 &child, &children) == 0) {
2738 for (c = 0; c < children; c++)
2739 if (find_vdev(child[c], search))
2740 return (B_TRUE);
2741 }
2742
2743 return (B_FALSE);
2744}
2745
2746static int
2747find_spare(zpool_handle_t *zhp, void *data)
2748{
2749 spare_cbdata_t *cbp = data;
2750 nvlist_t *config, *nvroot;
2751
2752 config = zpool_get_config(zhp, NULL);
2753 verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
2754 &nvroot) == 0);
2755
2756 if (find_vdev(nvroot, cbp->cb_guid)) {
2757 cbp->cb_zhp = zhp;
2758 return (1);
2759 }
2760
2761 zpool_close(zhp);
2762 return (0);
2763}
2764
2765/*
2766 * Print out configuration state as requested by status_callback.
2767 */
2768void
2769print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
2770 int namewidth, int depth, boolean_t isspare)
2771{
2772 nvlist_t **child;
2773 uint_t c, children;
2774 vdev_stat_t *vs;
2775 char rbuf[6], wbuf[6], cbuf[6], repaired[7];
2776 char *vname;
2777 uint64_t notpresent;
2778 spare_cbdata_t cb;
2779 char *state;
2780
2781 verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_STATS,
2782 (uint64_t **)&vs, &c) == 0);
2783
2784 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
2785 &child, &children) != 0)
2786 children = 0;
2787
2788 state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
2789 if (isspare) {
2790 /*
2791 * For hot spares, we use the terms 'INUSE' and 'AVAILABLE' for
2792 * online drives.
2793 */
2794 if (vs->vs_aux == VDEV_AUX_SPARED)
2795 state = "INUSE";
2796 else if (vs->vs_state == VDEV_STATE_HEALTHY)
2797 state = "AVAIL";
2798 }
2799
2800 (void) printf("\t%*s%-*s %-8s", depth, "", namewidth - depth,
2801 name, state);
2802
2803 if (!isspare) {
2804 zfs_nicenum(vs->vs_read_errors, rbuf, sizeof (rbuf));
2805 zfs_nicenum(vs->vs_write_errors, wbuf, sizeof (wbuf));
2806 zfs_nicenum(vs->vs_checksum_errors, cbuf, sizeof (cbuf));
2807 (void) printf(" %5s %5s %5s", rbuf, wbuf, cbuf);
2808 }
2809
2810 if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
2811 &notpresent) == 0) {
2812 char *path;
2813 verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0);
2814 (void) printf(" was %s", path);
2815 } else if (vs->vs_aux != 0) {
2816 (void) printf(" ");
2817
2818 switch (vs->vs_aux) {
2819 case VDEV_AUX_OPEN_FAILED:
2820 (void) printf(gettext("cannot open"));
2821 break;
2822
2823 case VDEV_AUX_BAD_GUID_SUM:
2824 (void) printf(gettext("missing device"));
2825 break;
2826
2827 case VDEV_AUX_NO_REPLICAS:
2828 (void) printf(gettext("insufficient replicas"));
2829 break;
2830
2831 case VDEV_AUX_VERSION_NEWER:
2832 (void) printf(gettext("newer version"));
2833 break;
2834
2835 case VDEV_AUX_SPARED:
2836 verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
2837 &cb.cb_guid) == 0);
2838 if (zpool_iter(g_zfs, find_spare, &cb) == 1) {
2839 if (strcmp(zpool_get_name(cb.cb_zhp),
2840 zpool_get_name(zhp)) == 0)
2841 (void) printf(gettext("currently in "
2842 "use"));
2843 else
2844 (void) printf(gettext("in use by "
2845 "pool '%s'"),
2846 zpool_get_name(cb.cb_zhp));
2847 zpool_close(cb.cb_zhp);
2848 } else {
2849 (void) printf(gettext("currently in use"));
2850 }
2851 break;
2852
2853 case VDEV_AUX_ERR_EXCEEDED:
2854 (void) printf(gettext("too many errors"));
2855 break;
2856
2857 case VDEV_AUX_IO_FAILURE:
2858 (void) printf(gettext("experienced I/O failures"));
2859 break;
2860
2861 case VDEV_AUX_BAD_LOG:
2862 (void) printf(gettext("bad intent log"));
2863 break;
2864
2865 default:
2866 (void) printf(gettext("corrupted data"));
2867 break;
2868 }
2869 } else if (vs->vs_scrub_repaired != 0 && children == 0) {
2870 /*
2871 * Report bytes resilvered/repaired on leaf devices.
2872 */
2873 zfs_nicenum(vs->vs_scrub_repaired, repaired, sizeof (repaired));
2874 (void) printf(gettext(" %s %s"), repaired,
2875 (vs->vs_scrub_type == POOL_SCRUB_RESILVER) ?
2876 "resilvered" : "repaired");
2877 }
2878
2879 (void) printf("\n");
2880
2881 for (c = 0; c < children; c++) {
2882 uint64_t is_log = B_FALSE;
2883
2884 /* Don't print logs here */
2885 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
2886 &is_log);
2887 if (is_log)
2888 continue;
2889 vname = zpool_vdev_name(g_zfs, zhp, child[c]);
2890 print_status_config(zhp, vname, child[c],
2891 namewidth, depth + 2, isspare);
2892 free(vname);
2893 }
2894}
2895
2896static void
2897print_error_log(zpool_handle_t *zhp)
2898{
2899 nvlist_t *nverrlist = NULL;
2900 nvpair_t *elem;
2901 char *pathname;
2902 size_t len = MAXPATHLEN * 2;
2903

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

2964 name = zpool_vdev_name(g_zfs, zhp, l2cache[i]);
2965 print_status_config(zhp, name, l2cache[i],
2966 namewidth, 2, B_FALSE);
2967 free(name);
2968 }
2969}
2970
2971/*
2929static void
2930print_error_log(zpool_handle_t *zhp)
2931{
2932 nvlist_t *nverrlist = NULL;
2933 nvpair_t *elem;
2934 char *pathname;
2935 size_t len = MAXPATHLEN * 2;
2936

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

2997 name = zpool_vdev_name(g_zfs, zhp, l2cache[i]);
2998 print_status_config(zhp, name, l2cache[i],
2999 namewidth, 2, B_FALSE);
3000 free(name);
3001 }
3002}
3003
3004/*
2972 * Print log vdevs.
2973 * Logs are recorded as top level vdevs in the main pool child array but with
2974 * "is_log" set to 1. We use print_status_config() to print the top level logs
2975 * then any log children (eg mirrored slogs) are printed recursively - which
2976 * works because only the top level vdev is marked "is_log"
2977 */
2978static void
2979print_logs(zpool_handle_t *zhp, nvlist_t *nv, int namewidth)
2980{
2981 uint_t c, children;
2982 nvlist_t **child;
2983
2984 if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, &child,
2985 &children) != 0)
2986 return;
2987
2988 (void) printf(gettext("\tlogs\n"));
2989
2990 for (c = 0; c < children; c++) {
2991 uint64_t is_log = B_FALSE;
2992 char *name;
2993
2994 (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
2995 &is_log);
2996 if (!is_log)
2997 continue;
2998 name = zpool_vdev_name(g_zfs, zhp, child[c]);
2999 print_status_config(zhp, name, child[c], namewidth, 2, B_FALSE);
3000 free(name);
3001 }
3002}
3003
3004/*
3005 * Display a summary of pool status. Displays a summary such as:
3006 *
3007 * pool: tank
3008 * status: DEGRADED
3009 * reason: One or more devices ...
3010 * see: http://www.sun.com/msg/ZFS-xxxx-01
3011 * config:
3012 * mirror DEGRADED

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

3224
3225 (void) printf(gettext("config:\n\n"));
3226 (void) printf(gettext("\t%-*s %-8s %5s %5s %5s\n"), namewidth,
3227 "NAME", "STATE", "READ", "WRITE", "CKSUM");
3228 print_status_config(zhp, zpool_get_name(zhp), nvroot,
3229 namewidth, 0, B_FALSE);
3230
3231 if (num_logs(nvroot) > 0)
3005 * Display a summary of pool status. Displays a summary such as:
3006 *
3007 * pool: tank
3008 * status: DEGRADED
3009 * reason: One or more devices ...
3010 * see: http://www.sun.com/msg/ZFS-xxxx-01
3011 * config:
3012 * mirror DEGRADED

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

3224
3225 (void) printf(gettext("config:\n\n"));
3226 (void) printf(gettext("\t%-*s %-8s %5s %5s %5s\n"), namewidth,
3227 "NAME", "STATE", "READ", "WRITE", "CKSUM");
3228 print_status_config(zhp, zpool_get_name(zhp), nvroot,
3229 namewidth, 0, B_FALSE);
3230
3231 if (num_logs(nvroot) > 0)
3232 print_logs(zhp, nvroot, namewidth);
3232 print_logs(zhp, nvroot, namewidth, B_TRUE);
3233 if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
3234 &l2cache, &nl2cache) == 0)
3235 print_l2cache(zhp, l2cache, nl2cache, namewidth);
3236
3237 if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
3238 &spares, &nspares) == 0)
3239 print_spares(zhp, spares, nspares, namewidth);
3240

--- 800 unchanged lines hidden ---
3233 if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
3234 &l2cache, &nl2cache) == 0)
3235 print_l2cache(zhp, l2cache, nl2cache, namewidth);
3236
3237 if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
3238 &spares, &nspares) == 0)
3239 print_spares(zhp, spares, nspares, namewidth);
3240

--- 800 unchanged lines hidden ---