Deleted Added
sdiff udiff text old ( 294027 ) new ( 294329 )
full compact
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 47 unchanged lines hidden (view full) ---

56static int vdev_geom_bio_flush_disable;
57SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RWTUN,
58 &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH");
59/* Don't send BIO_DELETE. */
60static int vdev_geom_bio_delete_disable;
61SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RWTUN,
62 &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE");
63
64static void
65vdev_geom_set_rotation_rate(vdev_t *vd, struct g_consumer *cp)
66{
67 int error;
68 uint16_t rate;
69
70 error = g_getattr("GEOM::rotation_rate", cp, &rate);
71 if (error == 0)

--- 249 unchanged lines hidden (view full) ---

321
322 g_destroy_bio(bp);
323 return (error);
324}
325
326static void
327vdev_geom_taste_orphan(struct g_consumer *cp)
328{
329
330 KASSERT(1 == 0, ("%s called while tasting %s.", __func__,
331 cp->provider->name));
332}
333
334static int
335vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config)
336{
337 struct g_provider *pp;
338 vdev_label_t *label;
339 char *p, *buf;

--- 230 unchanged lines hidden (view full) ---

570 struct g_geom *gp, *zgp;
571 struct g_provider *pp;
572 struct g_consumer *cp, *zcp;
573 uint64_t pguid, vguid;
574
575 g_topology_assert();
576
577 zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste");
578 /* This orphan function should be never called. */
579 zgp->orphan = vdev_geom_taste_orphan;
580 zcp = g_new_consumer(zgp);
581
582 cp = NULL;
583 LIST_FOREACH(mp, &g_classes, class) {
584 if (mp == &zfs_vdev_class)
585 continue;
586 LIST_FOREACH(gp, &mp->geom, geom) {

--- 110 unchanged lines hidden (view full) ---

697vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
698 uint64_t *logical_ashift, uint64_t *physical_ashift)
699{
700 struct g_provider *pp;
701 struct g_consumer *cp;
702 size_t bufsize;
703 int error;
704
705 /*
706 * We must have a pathname, and it must be absolute.
707 */
708 if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
709 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
710 return (EINVAL);
711 }
712

--- 33 unchanged lines hidden (view full) ---

746 * expected GUIDs. The disks might have merely
747 * moved around so try all other GEOM providers
748 * to find one with the right GUIDs.
749 */
750 cp = vdev_geom_open_by_guids(vd);
751 }
752 }
753
754 if (cp == NULL) {
755 ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
756 error = ENOENT;
757 } else if (cp->provider->sectorsize > VDEV_PAD_SIZE ||
758 !ISP2(cp->provider->sectorsize)) {
759 ZFS_LOG(1, "Provider %s has unsupported sectorsize.",
760 vd->vdev_path);
761

--- 229 unchanged lines hidden ---