diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c index 7eac42ce3630..dea1a8fa7bf1 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev.c @@ -155,6 +155,15 @@ static vdev_ops_t *vdev_ops_table[] = { }; +/* + * When a vdev is added, it will be divided into approximately (but no + * more than) this number of metaslabs. + */ +int metaslabs_per_vdev = 200; +SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, metaslabs_per_vdev, CTLFLAG_RDTUN, + &metaslabs_per_vdev, 0, + "When a vdev is added, how many metaslabs the vdev should be divided into"); + /* * Given a vdev type, return the appropriate ops vector. */ @@ -1663,9 +1672,9 @@ void vdev_metaslab_set_size(vdev_t *vd) { /* - * Aim for roughly 200 metaslabs per vdev. + * Aim for roughly metaslabs_per_vdev (default 200) metaslabs per vdev. */ - vd->vdev_ms_shift = highbit64(vd->vdev_asize / 200); + vd->vdev_ms_shift = highbit64(vd->vdev_asize / metaslabs_per_vdev); vd->vdev_ms_shift = MAX(vd->vdev_ms_shift, SPA_MAXBLOCKSHIFT); }