Refactor vdev_geom_attach and friends to reduce code duplication
authorasomers <asomers@FreeBSD.org>
Fri, 29 Apr 2016 15:23:51 +0000 (15:23 +0000)
committerasomers <asomers@FreeBSD.org>
Fri, 29 Apr 2016 15:23:51 +0000 (15:23 +0000)
commitccca204851efedb7169a5159aa59ba8bc0fec68c
tree46cf5c3f005a3778bfad884c7e05ddf85da5060f
parent72855a7c5d57ba89b8d5088dda0721c4d87d3a1b
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
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c