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 |
64/* 65 * Thread local storage used to indicate when a thread is probing geoms 66 * for their guids. If NULL, this thread is not tasting geoms. If non NULL, 67 * it is looking for a replacement for the vdev_t* that is its value. 68 */ 69uint_t zfs_geom_probe_vdev_key; 70 |
71static void 72vdev_geom_set_rotation_rate(vdev_t *vd, struct g_consumer *cp) 73{ 74 int error; 75 uint16_t rate; 76 77 error = g_getattr("GEOM::rotation_rate", cp, &rate); 78 if (error == 0) --- 249 unchanged lines hidden (view full) --- 328 329 g_destroy_bio(bp); 330 return (error); 331} 332 333static void 334vdev_geom_taste_orphan(struct g_consumer *cp) 335{ |
336 ZFS_LOG(0, "WARNING: Orphan %s while tasting its VDev GUID.", 337 cp->provider->name); |
338} 339 340static int 341vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config) 342{ 343 struct g_provider *pp; 344 vdev_label_t *label; 345 char *p, *buf; --- 230 unchanged lines hidden (view full) --- 576 struct g_geom *gp, *zgp; 577 struct g_provider *pp; 578 struct g_consumer *cp, *zcp; 579 uint64_t pguid, vguid; 580 581 g_topology_assert(); 582 583 zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste"); |
584 zgp->orphan = vdev_geom_taste_orphan; 585 zcp = g_new_consumer(zgp); 586 587 cp = NULL; 588 LIST_FOREACH(mp, &g_classes, class) { 589 if (mp == &zfs_vdev_class) 590 continue; 591 LIST_FOREACH(gp, &mp->geom, geom) { --- 110 unchanged lines hidden (view full) --- 702vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize, 703 uint64_t *logical_ashift, uint64_t *physical_ashift) 704{ 705 struct g_provider *pp; 706 struct g_consumer *cp; 707 size_t bufsize; 708 int error; 709 |
710 /* Set the TLS to indicate downstack that we should not access zvols*/ 711 VERIFY(tsd_set(zfs_geom_probe_vdev_key, vd) == 0); 712 |
713 /* 714 * We must have a pathname, and it must be absolute. 715 */ 716 if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') { 717 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL; 718 return (EINVAL); 719 } 720 --- 33 unchanged lines hidden (view full) --- 754 * expected GUIDs. The disks might have merely 755 * moved around so try all other GEOM providers 756 * to find one with the right GUIDs. 757 */ 758 cp = vdev_geom_open_by_guids(vd); 759 } 760 } 761 |
762 /* Clear the TLS now that tasting is done */ 763 VERIFY(tsd_set(zfs_geom_probe_vdev_key, NULL) == 0); 764 |
765 if (cp == NULL) { 766 ZFS_LOG(1, "Provider %s not found.", vd->vdev_path); 767 error = ENOENT; 768 } else if (cp->provider->sectorsize > VDEV_PAD_SIZE || 769 !ISP2(cp->provider->sectorsize)) { 770 ZFS_LOG(1, "Provider %s has unsupported sectorsize.", 771 vd->vdev_path); 772 --- 229 unchanged lines hidden --- |