mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Illumos 5269 - zpool import slow
5269 zpool import slow Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: George Wilson <george@delphix.com> Reviewed by: Dan McDonald <danmcd@omniti.com> Approved by: Dan McDonald <danmcd@omniti.com> References: https://www.illumos.org/issues/5269 https://github.com/illumos/illumos-gate/commit/12380e1e Ported-by: DHE <git@dehacked.net> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3396
This commit is contained in:
committed by
Brian Behlendorf
parent
d050c627b5
commit
9c43027b3f
@@ -179,6 +179,27 @@ vdev_lookup_by_guid(vdev_t *vd, uint64_t guid)
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
static int
|
||||
vdev_count_leaves_impl(vdev_t *vd)
|
||||
{
|
||||
int n = 0;
|
||||
int c;
|
||||
|
||||
if (vd->vdev_ops->vdev_op_leaf)
|
||||
return (1);
|
||||
|
||||
for (c = 0; c < vd->vdev_children; c++)
|
||||
n += vdev_count_leaves_impl(vd->vdev_child[c]);
|
||||
|
||||
return (n);
|
||||
}
|
||||
|
||||
int
|
||||
vdev_count_leaves(spa_t *spa)
|
||||
{
|
||||
return (vdev_count_leaves_impl(spa->spa_root_vdev));
|
||||
}
|
||||
|
||||
void
|
||||
vdev_add_child(vdev_t *pvd, vdev_t *cvd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user