equal
deleted
inserted
replaced
16 * fields enclosed by brackets "[]" replaced with your own identifying |
16 * fields enclosed by brackets "[]" replaced with your own identifying |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
17 * information: Portions Copyright [yyyy] [name of copyright owner] |
18 * |
18 * |
19 * CDDL HEADER END |
19 * CDDL HEADER END |
20 */ |
20 */ |
|
21 |
21 /* |
22 /* |
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. |
23 * Use is subject to license terms. |
24 * Use is subject to license terms. |
|
25 */ |
|
26 |
|
27 /* |
|
28 * Copyright (c) 2012 by Delphix. All rights reserved. |
24 */ |
29 */ |
25 |
30 |
26 /* |
31 /* |
27 * The pool configuration repository is stored in /etc/zfs/zpool.cache as a |
32 * The pool configuration repository is stored in /etc/zfs/zpool.cache as a |
28 * single packed nvlist. While it would be nice to just read in this |
33 * single packed nvlist. While it would be nice to just read in this |
216 *oldconfig = zhp->zpool_old_config; |
221 *oldconfig = zhp->zpool_old_config; |
217 return (zhp->zpool_config); |
222 return (zhp->zpool_config); |
218 } |
223 } |
219 |
224 |
220 /* |
225 /* |
|
226 * Retrieves a list of enabled features and their refcounts and caches it in |
|
227 * the pool handle. |
|
228 */ |
|
229 nvlist_t * |
|
230 zpool_get_features(zpool_handle_t *zhp) |
|
231 { |
|
232 nvlist_t *config, *features; |
|
233 |
|
234 config = zpool_get_config(zhp, NULL); |
|
235 |
|
236 if (config == NULL || !nvlist_exists(config, |
|
237 ZPOOL_CONFIG_FEATURE_STATS)) { |
|
238 int error; |
|
239 boolean_t missing = B_FALSE; |
|
240 |
|
241 error = zpool_refresh_stats(zhp, &missing); |
|
242 |
|
243 if (error != 0 || missing) |
|
244 return (NULL); |
|
245 |
|
246 config = zpool_get_config(zhp, NULL); |
|
247 } |
|
248 |
|
249 verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS, |
|
250 &features) == 0); |
|
251 |
|
252 return (features); |
|
253 } |
|
254 |
|
255 /* |
221 * Refresh the vdev statistics associated with the given pool. This is used in |
256 * Refresh the vdev statistics associated with the given pool. This is used in |
222 * iostat to show configuration changes and determine the delta from the last |
257 * iostat to show configuration changes and determine the delta from the last |
223 * time the function was called. This function can fail, in case the pool has |
258 * time the function was called. This function can fail, in case the pool has |
224 * been destroyed. |
259 * been destroyed. |
225 */ |
260 */ |