HomeFreeBSD

Refactor vdev_geom_attach and friends to reduce code duplication

Description

Refactor vdev_geom_attach and friends to reduce code duplication

sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
Move checks for provider's sectorsize and mediasize into a single
location in vdev_geom_attach. Remove the zfs::vdev::taste class;
it's ok to use the regular vdev class for tasting. Consolidate guid
checks into a single location in vdev_attach_ok. Consolidate some
error handling code from vdev_geom_attach into vdev_geom_detach,
closing a resource leak of geom consumers in the process.

Reviewed by: avg
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D5974

Details

Provenance
asomersAuthored on
Reviewer
avg
Differential Revision
D5974: Refactor vdev_geom_attach and friends to reduce code duplication
Parents
rS298785: MFC r270256, r298640:
Branches
Unknown
Tags
Unknown