aboutsummaryrefslogtreecommitdiff
path: root/module/zfs/spa.c
diff options
context:
space:
mode:
authorGeorge Wilson <george.wilson@delphix.com>2014-07-19 20:19:24 +0000
committerBrian Behlendorf <behlendorf1@llnl.gov>2014-08-18 15:40:49 +0000
commitf3a7f6610f2df0217ba3b99099019417a954b673 (patch)
tree720f77d117032a585761dd5bb80e5a5694915111 /module/zfs/spa.c
parentf67d709080f3d4a247191f0d25cbedc5da103f78 (diff)
downloadsrc-f3a7f6610f2df0217ba3b99099019417a954b673.tar.gz
src-f3a7f6610f2df0217ba3b99099019417a954b673.zip
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r--module/zfs/spa.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/module/zfs/spa.c b/module/zfs/spa.c
index 7bd254aa554d..0824f9c7f846 100644
--- a/module/zfs/spa.c
+++ b/module/zfs/spa.c
@@ -190,13 +190,10 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp)
{
vdev_t *rvd = spa->spa_root_vdev;
dsl_pool_t *pool = spa->spa_dsl_pool;
- uint64_t size;
- uint64_t alloc;
- uint64_t space;
- uint64_t cap, version;
+ uint64_t size, alloc, cap, version;
zprop_source_t src = ZPROP_SRC_NONE;
spa_config_dirent_t *dp;
- int c;
+ metaslab_class_t *mc = spa_normal_class(spa);
ASSERT(MUTEX_HELD(&spa->spa_props_lock));
@@ -209,14 +206,10 @@ spa_prop_get_config(spa_t *spa, nvlist_t **nvp)
spa_prop_add_list(*nvp, ZPOOL_PROP_FREE, NULL,
size - alloc, src);
- space = 0;
- for (c = 0; c < rvd->vdev_children; c++) {
- vdev_t *tvd = rvd->vdev_child[c];
- space += tvd->vdev_max_asize - tvd->vdev_asize;
- }
- spa_prop_add_list(*nvp, ZPOOL_PROP_EXPANDSZ, NULL, space,
- src);
-
+ spa_prop_add_list(*nvp, ZPOOL_PROP_FRAGMENTATION, NULL,
+ metaslab_class_fragmentation(mc), src);
+ spa_prop_add_list(*nvp, ZPOOL_PROP_EXPANDSZ, NULL,
+ metaslab_class_expandable_space(mc), src);
spa_prop_add_list(*nvp, ZPOOL_PROP_READONLY, NULL,
(spa_mode(spa) == FREAD), src);