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.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
23 * All rights reserved.
25 * Portions Copyright (c) 2012 Martin Matuska <mm@FreeBSD.org>
28 #include <sys/zfs_context.h>
29 #include <sys/param.h>
30 #include <sys/kernel.h>
34 #include <sys/spa_impl.h>
35 #include <sys/vdev_impl.h>
36 #include <sys/fs/zfs.h>
38 #include <geom/geom.h>
39 #include <geom/geom_int.h>
42 * Virtual device vector for GEOM.
45 static g_attrchanged_t vdev_geom_attrchanged;
46 struct g_class zfs_vdev_class = {
49 .attrchanged = vdev_geom_attrchanged,
52 DECLARE_GEOM_CLASS(zfs_vdev_class, zfs_vdev);
54 SYSCTL_DECL(_vfs_zfs_vdev);
55 /* Don't send BIO_FLUSH. */
56 static int vdev_geom_bio_flush_disable = 0;
57 TUNABLE_INT("vfs.zfs.vdev.bio_flush_disable", &vdev_geom_bio_flush_disable);
58 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_flush_disable, CTLFLAG_RW,
59 &vdev_geom_bio_flush_disable, 0, "Disable BIO_FLUSH");
60 /* Don't send BIO_DELETE. */
61 static int vdev_geom_bio_delete_disable = 0;
62 TUNABLE_INT("vfs.zfs.vdev.bio_delete_disable", &vdev_geom_bio_delete_disable);
63 SYSCTL_INT(_vfs_zfs_vdev, OID_AUTO, bio_delete_disable, CTLFLAG_RW,
64 &vdev_geom_bio_delete_disable, 0, "Disable BIO_DELETE");
66 /* Declare local functions */
67 static void vdev_geom_detach(struct g_consumer *cp, boolean_t open_for_read);
70 * Thread local storage used to indicate when a thread is probing geoms
71 * for their guids. If NULL, this thread is not tasting geoms. If non NULL,
72 * it is looking for a replacement for the vdev_t* that is its value.
74 uint_t zfs_geom_probe_vdev_key;
77 vdev_geom_set_rotation_rate(vdev_t *vd, struct g_consumer *cp)
82 error = g_getattr("GEOM::rotation_rate", cp, &rate);
84 vd->vdev_rotation_rate = rate;
86 vd->vdev_rotation_rate = VDEV_RATE_UNKNOWN;
90 vdev_geom_attrchanged(struct g_consumer *cp, const char *attr)
95 int error, physpath_len;
101 if (strcmp(attr, "GEOM::rotation_rate") == 0) {
102 vdev_geom_set_rotation_rate(vd, cp);
106 if (strcmp(attr, "GEOM::physpath") != 0)
109 if (g_access(cp, 1, 0, 0) != 0)
113 * Record/Update physical path information for this device.
116 physpath_len = MAXPATHLEN;
117 physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO);
118 error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath);
119 g_access(cp, -1, 0, 0);
123 /* g_topology lock ensures that vdev has not been closed */
125 old_physpath = vd->vdev_physpath;
126 vd->vdev_physpath = spa_strdup(physpath);
127 spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE);
129 if (old_physpath != NULL)
130 spa_strfree(old_physpath);
136 vdev_geom_orphan(struct g_consumer *cp)
144 /* Vdev close in progress. Ignore the event. */
149 * Orphan callbacks occur from the GEOM event thread.
150 * Concurrent with this call, new I/O requests may be
151 * working their way through GEOM about to find out
152 * (only once executed by the g_down thread) that we've
153 * been orphaned from our disk provider. These I/Os
154 * must be retired before we can detach our consumer.
155 * This is most easily achieved by acquiring the
156 * SPA ZIO configuration lock as a writer, but doing
157 * so with the GEOM topology lock held would cause
158 * a lock order reversal. Instead, rely on the SPA's
159 * async removal support to invoke a close on this
160 * vdev once it is safe to do so.
162 vd->vdev_remove_wanted = B_TRUE;
163 spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE);
166 static struct g_consumer *
167 vdev_geom_attach(struct g_provider *pp, vdev_t *vd)
170 struct g_consumer *cp;
175 ZFS_LOG(1, "Attaching to %s.", pp->name);
177 if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize)) {
178 ZFS_LOG(1, "Failing attach of %s. Incompatible sectorsize %d\n",
179 pp->name, pp->sectorsize);
181 } else if (pp->mediasize < SPA_MINDEVSIZE) {
182 ZFS_LOG(1, "Failing attach of %s. Incompatible mediasize %ju\n",
183 pp->name, pp->mediasize);
187 /* Do we have geom already? No? Create one. */
188 LIST_FOREACH(gp, &zfs_vdev_class.geom, geom) {
189 if (gp->flags & G_GEOM_WITHER)
191 if (strcmp(gp->name, "zfs::vdev") != 0)
196 gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev");
197 gp->orphan = vdev_geom_orphan;
198 gp->attrchanged = vdev_geom_attrchanged;
199 cp = g_new_consumer(gp);
200 error = g_attach(cp, pp);
202 ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__,
204 vdev_geom_detach(cp, B_FALSE);
207 error = g_access(cp, 1, 0, 1);
209 ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__,
211 vdev_geom_detach(cp, B_FALSE);
214 ZFS_LOG(1, "Created geom and consumer for %s.", pp->name);
216 /* Check if we are already connected to this provider. */
217 LIST_FOREACH(cp, &gp->consumer, consumer) {
218 if (cp->provider == pp) {
219 ZFS_LOG(1, "Found consumer for %s.", pp->name);
224 cp = g_new_consumer(gp);
225 error = g_attach(cp, pp);
227 ZFS_LOG(1, "%s(%d): g_attach failed: %d\n",
228 __func__, __LINE__, error);
229 vdev_geom_detach(cp, B_FALSE);
232 error = g_access(cp, 1, 0, 1);
234 ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
235 __func__, __LINE__, error);
236 vdev_geom_detach(cp, B_FALSE);
239 ZFS_LOG(1, "Created consumer for %s.", pp->name);
241 error = g_access(cp, 1, 0, 1);
243 ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
244 __func__, __LINE__, error);
247 ZFS_LOG(1, "Used existing consumer for %s.", pp->name);
252 * BUG: cp may already belong to a vdev. This could happen if:
253 * 1) That vdev is a shared spare, or
254 * 2) We are trying to reopen a missing vdev and we are scanning by
255 * guid. In that case, we'll ultimately fail to open this consumer,
256 * but not until after setting the private field.
257 * The solution is to:
258 * 1) Don't set the private field until after the open succeeds, and
259 * 2) Set it to a linked list of vdevs, not just a single vdev
265 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
270 vdev_geom_detach(struct g_consumer *cp, boolean_t open_for_read)
277 ZFS_LOG(1, "Detaching consumer. Provider %s.",
278 cp->provider && cp->provider->name ? cp->provider->name : "NULL");
285 g_access(cp, -1, 0, -1);
286 /* Destroy consumer on last close. */
287 if (cp->acr == 0 && cp->ace == 0) {
289 g_access(cp, 0, -cp->acw, 0);
290 if (cp->provider != NULL) {
291 ZFS_LOG(1, "Destroying consumer to %s.",
292 cp->provider->name ? cp->provider->name : "NULL");
295 g_destroy_consumer(cp);
297 /* Destroy geom if there are no consumers left. */
298 if (LIST_EMPTY(&gp->consumer)) {
299 ZFS_LOG(1, "Destroyed geom %s.", gp->name);
300 g_wither_geom(gp, ENXIO);
305 vdev_geom_close_locked(vdev_t *vd)
307 struct g_consumer *cp;
313 vd->vdev_delayed_close = B_FALSE;
317 ZFS_LOG(1, "Closing access to %s.", cp->provider->name);
319 vdev_geom_detach(cp, B_TRUE);
323 nvlist_get_guids(nvlist_t *list, uint64_t *pguid, uint64_t *vguid)
326 (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, vguid);
327 (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid);
331 vdev_geom_io(struct g_consumer *cp, int cmd, void *data, off_t offset, off_t size)
338 ASSERT((offset % cp->provider->sectorsize) == 0);
339 ASSERT((size % cp->provider->sectorsize) == 0);
345 maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize);
348 for (; off < offset; off += maxio, p += maxio, size -= maxio) {
349 bzero(bp, sizeof(*bp));
352 bp->bio_offset = off;
353 bp->bio_length = MIN(size, maxio);
355 g_io_request(bp, cp);
356 error = biowait(bp, "vdev_geom_io");
366 vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config)
368 struct g_provider *pp;
377 g_topology_assert_not();
380 ZFS_LOG(1, "Reading config from %s...", pp->name);
382 psize = pp->mediasize;
383 psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t));
385 size = sizeof(*label) + pp->sectorsize -
386 ((sizeof(*label) - 1) % pp->sectorsize) - 1;
388 label = kmem_alloc(size, KM_SLEEP);
389 buflen = sizeof(label->vl_vdev_phys.vp_nvlist);
392 for (l = 0; l < VDEV_LABELS; l++) {
394 offset = vdev_label_offset(psize, l, 0);
395 if ((offset % pp->sectorsize) != 0)
398 if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0)
400 buf = label->vl_vdev_phys.vp_nvlist;
402 if (nvlist_unpack(buf, buflen, config, 0) != 0)
405 if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
406 &state) != 0 || state > POOL_STATE_L2CACHE) {
407 nvlist_free(*config);
412 if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
413 (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
414 &txg) != 0 || txg == 0)) {
415 nvlist_free(*config);
423 kmem_free(label, size);
424 return (*config == NULL ? ENOENT : 0);
428 resize_configs(nvlist_t ***configs, uint64_t *count, uint64_t id)
430 nvlist_t **new_configs;
435 new_configs = kmem_zalloc((id + 1) * sizeof(nvlist_t *),
437 for (i = 0; i < *count; i++)
438 new_configs[i] = (*configs)[i];
439 if (*configs != NULL)
440 kmem_free(*configs, *count * sizeof(void *));
441 *configs = new_configs;
446 process_vdev_config(nvlist_t ***configs, uint64_t *count, nvlist_t *cfg,
447 const char *name, uint64_t* known_pool_guid)
451 uint64_t vdev_guid, known_guid;
452 uint64_t id, txg, known_txg;
456 if (nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 ||
457 strcmp(pname, name) != 0)
460 if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_GUID, &pool_guid) != 0)
463 if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_TOP_GUID, &vdev_guid) != 0)
466 if (nvlist_lookup_nvlist(cfg, ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0)
469 if (nvlist_lookup_uint64(vdev_tree, ZPOOL_CONFIG_ID, &id) != 0)
472 VERIFY(nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, &txg) == 0);
474 if (*known_pool_guid != 0) {
475 if (pool_guid != *known_pool_guid)
478 *known_pool_guid = pool_guid;
480 resize_configs(configs, count, id);
482 if ((*configs)[id] != NULL) {
483 VERIFY(nvlist_lookup_uint64((*configs)[id],
484 ZPOOL_CONFIG_POOL_TXG, &known_txg) == 0);
485 if (txg <= known_txg)
487 nvlist_free((*configs)[id]);
490 (*configs)[id] = cfg;
498 vdev_geom_read_pool_label(const char *name,
499 nvlist_t ***configs, uint64_t *count)
503 struct g_provider *pp;
504 struct g_consumer *zcp;
515 LIST_FOREACH(mp, &g_classes, class) {
516 if (mp == &zfs_vdev_class)
518 LIST_FOREACH(gp, &mp->geom, geom) {
519 if (gp->flags & G_GEOM_WITHER)
521 LIST_FOREACH(pp, &gp->provider, provider) {
522 if (pp->flags & G_PF_WITHER)
524 zcp = vdev_geom_attach(pp, NULL);
528 error = vdev_geom_read_config(zcp, &vdev_cfg);
530 vdev_geom_detach(zcp, B_TRUE);
533 ZFS_LOG(1, "successfully read vdev config");
535 process_vdev_config(configs, count,
536 vdev_cfg, name, &pool_guid);
543 return (*count > 0 ? 0 : ENOENT);
547 vdev_geom_read_guids(struct g_consumer *cp, uint64_t *pguid, uint64_t *vguid)
551 g_topology_assert_not();
555 if (vdev_geom_read_config(cp, &config) == 0) {
556 nvlist_get_guids(config, pguid, vguid);
562 vdev_attach_ok(vdev_t *vd, struct g_provider *pp)
566 struct g_consumer *zcp;
570 zcp = vdev_geom_attach(pp, NULL);
572 ZFS_LOG(1, "Unable to attach tasting instance to %s.",
577 vdev_geom_read_guids(zcp, &pool_guid, &vdev_guid);
579 vdev_geom_detach(zcp, B_TRUE);
582 * Check that the label's vdev guid matches the desired guid. If the
583 * label has a pool guid, check that it matches too. (Inactive spares
584 * and L2ARCs do not have any pool guid in the label.)
586 if ((pool_guid == 0 || pool_guid == spa_guid(vd->vdev_spa)) &&
587 vdev_guid == vd->vdev_guid) {
588 ZFS_LOG(1, "guids match for provider %s.", vd->vdev_path);
591 ZFS_LOG(1, "guid mismatch for provider %s: "
592 "%ju:%ju != %ju:%ju.", vd->vdev_path,
593 (uintmax_t)spa_guid(vd->vdev_spa),
594 (uintmax_t)vd->vdev_guid,
595 (uintmax_t)pool_guid, (uintmax_t)vdev_guid);
600 static struct g_consumer *
601 vdev_geom_attach_by_guids(vdev_t *vd)
605 struct g_provider *pp;
606 struct g_consumer *cp;
611 LIST_FOREACH(mp, &g_classes, class) {
612 if (mp == &zfs_vdev_class)
614 LIST_FOREACH(gp, &mp->geom, geom) {
615 if (gp->flags & G_GEOM_WITHER)
617 LIST_FOREACH(pp, &gp->provider, provider) {
618 if (!vdev_attach_ok(vd, pp))
620 cp = vdev_geom_attach(pp, vd);
622 printf("ZFS WARNING: Unable to "
623 "attach to %s.\n", pp->name);
638 static struct g_consumer *
639 vdev_geom_open_by_guids(vdev_t *vd)
641 struct g_consumer *cp;
647 ZFS_LOG(1, "Searching by guids [%ju:%ju].",
648 (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid);
649 cp = vdev_geom_attach_by_guids(vd);
651 len = strlen(cp->provider->name) + strlen("/dev/") + 1;
652 buf = kmem_alloc(len, KM_SLEEP);
654 snprintf(buf, len, "/dev/%s", cp->provider->name);
655 spa_strfree(vd->vdev_path);
658 ZFS_LOG(1, "Attach by guid [%ju:%ju] succeeded, provider %s.",
659 (uintmax_t)spa_guid(vd->vdev_spa),
660 (uintmax_t)vd->vdev_guid, vd->vdev_path);
662 ZFS_LOG(1, "Search by guid [%ju:%ju] failed.",
663 (uintmax_t)spa_guid(vd->vdev_spa),
664 (uintmax_t)vd->vdev_guid);
670 static struct g_consumer *
671 vdev_geom_open_by_path(vdev_t *vd, int check_guid)
673 struct g_provider *pp;
674 struct g_consumer *cp;
679 pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1);
681 ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path);
682 if (!check_guid || vdev_attach_ok(vd, pp))
683 cp = vdev_geom_attach(pp, vd);
690 vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
691 uint64_t *logical_ashift, uint64_t *physical_ashift)
693 struct g_provider *pp;
694 struct g_consumer *cp;
698 /* Set the TLS to indicate downstack that we should not access zvols*/
699 VERIFY(tsd_set(zfs_geom_probe_vdev_key, vd) == 0);
702 * We must have a pathname, and it must be absolute.
704 if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
705 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
715 if (vd->vdev_spa->spa_splitting_newspa ||
716 (vd->vdev_prevstate == VDEV_STATE_UNKNOWN &&
717 vd->vdev_spa->spa_load_state == SPA_LOAD_NONE ||
718 vd->vdev_spa->spa_load_state == SPA_LOAD_CREATE)) {
720 * We are dealing with a vdev that hasn't been previously
721 * opened (since boot), and we are not loading an
722 * existing pool configuration. This looks like a
723 * vdev add operation to a new or existing pool.
724 * Assume the user knows what he/she is doing and find
725 * GEOM provider by its name, ignoring GUID mismatches.
727 * XXPOLICY: It would be safer to only allow a device
728 * that is unlabeled or labeled but missing
729 * GUID information to be opened in this fashion,
730 * unless we are doing a split, in which case we
731 * should allow any guid.
733 cp = vdev_geom_open_by_path(vd, 0);
736 * Try using the recorded path for this device, but only
737 * accept it if its label data contains the expected GUIDs.
739 cp = vdev_geom_open_by_path(vd, 1);
742 * The device at vd->vdev_path doesn't have the
743 * expected GUIDs. The disks might have merely
744 * moved around so try all other GEOM providers
745 * to find one with the right GUIDs.
747 cp = vdev_geom_open_by_guids(vd);
751 /* Clear the TLS now that tasting is done */
752 VERIFY(tsd_set(zfs_geom_probe_vdev_key, NULL) == 0);
755 ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
757 } else if (cp->provider->sectorsize > VDEV_PAD_SIZE ||
758 !ISP2(cp->provider->sectorsize)) {
759 ZFS_LOG(1, "Provider %s has unsupported sectorsize.",
762 vdev_geom_close_locked(vd);
765 } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) {
768 for (i = 0; i < 5; i++) {
769 error = g_access(cp, 0, 1, 0);
773 tsleep(vd, 0, "vdev", hz / 2);
777 printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n",
778 vd->vdev_path, error);
779 vdev_geom_close_locked(vd);
784 /* Fetch initial physical path information for this device. */
786 vdev_geom_attrchanged(cp, "GEOM::physpath");
791 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;
797 * Determine the actual size of the device.
799 *max_psize = *psize = pp->mediasize;
802 * Determine the device's minimum transfer size and preferred
805 *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1;
806 *physical_ashift = 0;
807 if (pp->stripesize > (1 << *logical_ashift) && ISP2(pp->stripesize) &&
808 pp->stripesize <= (1 << SPA_MAXASHIFT) && pp->stripeoffset == 0)
809 *physical_ashift = highbit(pp->stripesize) - 1;
812 * Clear the nowritecache settings, so that on a vdev_reopen()
815 vd->vdev_nowritecache = B_FALSE;
818 * Determine the device's rotation rate.
820 vdev_geom_set_rotation_rate(vd, cp);
826 vdev_geom_close(vdev_t *vd)
831 vdev_geom_close_locked(vd);
837 vdev_geom_io_intr(struct bio *bp)
842 zio = bp->bio_caller1;
844 zio->io_error = bp->bio_error;
845 if (zio->io_error == 0 && bp->bio_resid != 0)
846 zio->io_error = SET_ERROR(EIO);
848 switch(zio->io_error) {
851 * If we get ENOTSUP for BIO_FLUSH or BIO_DELETE we know
852 * that future attempts will never succeed. In this case
853 * we set a persistent flag so that we don't bother with
854 * requests in the future.
856 switch(bp->bio_cmd) {
858 vd->vdev_nowritecache = B_TRUE;
861 vd->vdev_notrim = B_TRUE;
866 if (!vd->vdev_remove_wanted) {
868 * If provider's error is set we assume it is being
871 if (bp->bio_to->error != 0) {
872 vd->vdev_remove_wanted = B_TRUE;
873 spa_async_request(zio->io_spa,
875 } else if (!vd->vdev_delayed_close) {
876 vd->vdev_delayed_close = B_TRUE;
882 zio_delay_interrupt(zio);
886 vdev_geom_io_start(zio_t *zio)
889 struct g_consumer *cp;
895 switch (zio->io_type) {
898 if (!vdev_readable(vd)) {
899 zio->io_error = SET_ERROR(ENXIO);
903 switch (zio->io_cmd) {
904 case DKIOCFLUSHWRITECACHE:
905 if (zfs_nocacheflush || vdev_geom_bio_flush_disable)
907 if (vd->vdev_nowritecache) {
908 zio->io_error = SET_ERROR(ENOTSUP);
913 zio->io_error = SET_ERROR(ENOTSUP);
920 if (vd->vdev_notrim) {
921 zio->io_error = SET_ERROR(ENOTSUP);
922 } else if (!vdev_geom_bio_delete_disable) {
929 ASSERT(zio->io_type == ZIO_TYPE_READ ||
930 zio->io_type == ZIO_TYPE_WRITE ||
931 zio->io_type == ZIO_TYPE_FREE ||
932 zio->io_type == ZIO_TYPE_IOCTL);
936 zio->io_error = SET_ERROR(ENXIO);
941 bp->bio_caller1 = zio;
942 switch (zio->io_type) {
945 zio->io_target_timestamp = zio_handle_io_delay(zio);
946 bp->bio_cmd = zio->io_type == ZIO_TYPE_READ ? BIO_READ : BIO_WRITE;
947 bp->bio_data = zio->io_data;
948 bp->bio_offset = zio->io_offset;
949 bp->bio_length = zio->io_size;
952 bp->bio_cmd = BIO_DELETE;
954 bp->bio_offset = zio->io_offset;
955 bp->bio_length = zio->io_size;
958 bp->bio_cmd = BIO_FLUSH;
959 bp->bio_flags |= BIO_ORDERED;
961 bp->bio_offset = cp->provider->mediasize;
965 bp->bio_done = vdev_geom_io_intr;
967 g_io_request(bp, cp);
971 vdev_geom_io_done(zio_t *zio)
976 vdev_geom_hold(vdev_t *vd)
981 vdev_geom_rele(vdev_t *vd)
985 vdev_ops_t vdev_geom_ops = {
994 VDEV_TYPE_DISK, /* name of this vdev type */
995 B_TRUE /* leaf vdev */