diff options
author | Don Brady <don.brady@delphix.com> | 2018-09-06 01:33:36 +0000 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2018-09-06 01:33:36 +0000 |
commit | cc99f275a28c43fe450a66a7544f73c4935f7361 (patch) | |
tree | f867e1d2cbb550a047c0f87986831252c41a2fd9 /module/zfs/vdev_label.c | |
parent | cfa37548ebc880580782b245f2d233ed540e7a01 (diff) | |
download | src-cc99f275a28c43fe450a66a7544f73c4935f7361.tar.gz src-cc99f275a28c43fe450a66a7544f73c4935f7361.zip |
Diffstat (limited to 'module/zfs/vdev_label.c')
-rw-r--r-- | module/zfs/vdev_label.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/module/zfs/vdev_label.c b/module/zfs/vdev_label.c index 29d7d651bf0d..439ab7438d90 100644 --- a/module/zfs/vdev_label.c +++ b/module/zfs/vdev_label.c @@ -22,6 +22,8 @@ /* * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2018 by Delphix. All rights reserved. + * Copyright (c) 2012, 2016 by Delphix. All rights reserved. + * Copyright (c) 2017, Intel Corporation. */ /* @@ -463,6 +465,28 @@ vdev_config_generate(spa_t *spa, vdev_t *vd, boolean_t getstats, fnvlist_add_uint64(nv, ZPOOL_CONFIG_REMOVING, vd->vdev_removing); } + + /* zpool command expects alloc class data */ + if (getstats && vd->vdev_alloc_bias != VDEV_BIAS_NONE) { + const char *bias = NULL; + + switch (vd->vdev_alloc_bias) { + case VDEV_BIAS_LOG: + bias = VDEV_ALLOC_BIAS_LOG; + break; + case VDEV_BIAS_SPECIAL: + bias = VDEV_ALLOC_BIAS_SPECIAL; + break; + case VDEV_BIAS_DEDUP: + bias = VDEV_ALLOC_BIAS_DEDUP; + break; + default: + ASSERT3U(vd->vdev_alloc_bias, ==, + VDEV_BIAS_NONE); + } + fnvlist_add_string(nv, ZPOOL_CONFIG_ALLOCATION_BIAS, + bias); + } } if (vd->vdev_dtl_sm != NULL) { |