diff options
Diffstat (limited to 'module/zfs/spa.c')
-rw-r--r-- | module/zfs/spa.c | 19 |
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); |