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");
67 vdev_geom_set_rotation_rate(vdev_t *vd, struct g_consumer *cp)
72 error = g_getattr("GEOM::rotation_rate", cp, &rate);
74 vd->vdev_rotation_rate = rate;
76 vd->vdev_rotation_rate = VDEV_RATE_UNKNOWN;
80 vdev_geom_attrchanged(struct g_consumer *cp, const char *attr)
85 int error, physpath_len;
91 if (strcmp(attr, "GEOM::rotation_rate") == 0) {
92 vdev_geom_set_rotation_rate(vd, cp);
96 if (strcmp(attr, "GEOM::physpath") != 0)
99 if (g_access(cp, 1, 0, 0) != 0)
103 * Record/Update physical path information for this device.
106 physpath_len = MAXPATHLEN;
107 physpath = g_malloc(physpath_len, M_WAITOK|M_ZERO);
108 error = g_io_getattr("GEOM::physpath", cp, &physpath_len, physpath);
109 g_access(cp, -1, 0, 0);
113 /* g_topology lock ensures that vdev has not been closed */
115 old_physpath = vd->vdev_physpath;
116 vd->vdev_physpath = spa_strdup(physpath);
117 spa_async_request(spa, SPA_ASYNC_CONFIG_UPDATE);
119 if (old_physpath != NULL)
120 spa_strfree(old_physpath);
126 vdev_geom_orphan(struct g_consumer *cp)
134 /* Vdev close in progress. Ignore the event. */
139 * Orphan callbacks occur from the GEOM event thread.
140 * Concurrent with this call, new I/O requests may be
141 * working their way through GEOM about to find out
142 * (only once executed by the g_down thread) that we've
143 * been orphaned from our disk provider. These I/Os
144 * must be retired before we can detach our consumer.
145 * This is most easily achieved by acquiring the
146 * SPA ZIO configuration lock as a writer, but doing
147 * so with the GEOM topology lock held would cause
148 * a lock order reversal. Instead, rely on the SPA's
149 * async removal support to invoke a close on this
150 * vdev once it is safe to do so.
152 vd->vdev_remove_wanted = B_TRUE;
153 spa_async_request(vd->vdev_spa, SPA_ASYNC_REMOVE);
156 static struct g_consumer *
157 vdev_geom_attach(struct g_provider *pp, vdev_t *vd)
160 struct g_consumer *cp;
165 ZFS_LOG(1, "Attaching to %s.", pp->name);
166 /* Do we have geom already? No? Create one. */
167 LIST_FOREACH(gp, &zfs_vdev_class.geom, geom) {
168 if (gp->flags & G_GEOM_WITHER)
170 if (strcmp(gp->name, "zfs::vdev") != 0)
175 gp = g_new_geomf(&zfs_vdev_class, "zfs::vdev");
176 gp->orphan = vdev_geom_orphan;
177 gp->attrchanged = vdev_geom_attrchanged;
178 cp = g_new_consumer(gp);
179 error = g_attach(cp, pp);
181 ZFS_LOG(1, "%s(%d): g_attach failed: %d\n", __func__,
183 g_wither_geom(gp, ENXIO);
186 error = g_access(cp, 1, 0, 1);
188 ZFS_LOG(1, "%s(%d): g_access failed: %d\n", __func__,
190 g_wither_geom(gp, ENXIO);
193 ZFS_LOG(1, "Created geom and consumer for %s.", pp->name);
195 /* Check if we are already connected to this provider. */
196 LIST_FOREACH(cp, &gp->consumer, consumer) {
197 if (cp->provider == pp) {
198 ZFS_LOG(1, "Found consumer for %s.", pp->name);
203 cp = g_new_consumer(gp);
204 error = g_attach(cp, pp);
206 ZFS_LOG(1, "%s(%d): g_attach failed: %d\n",
207 __func__, __LINE__, error);
208 g_destroy_consumer(cp);
211 error = g_access(cp, 1, 0, 1);
213 ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
214 __func__, __LINE__, error);
216 g_destroy_consumer(cp);
219 ZFS_LOG(1, "Created consumer for %s.", pp->name);
221 error = g_access(cp, 1, 0, 1);
223 ZFS_LOG(1, "%s(%d): g_access failed: %d\n",
224 __func__, __LINE__, error);
227 ZFS_LOG(1, "Used existing consumer for %s.", pp->name);
232 * BUG: cp may already belong to a vdev. This could happen if:
233 * 1) That vdev is a shared spare, or
234 * 2) We are trying to reopen a missing vdev and we are scanning by
235 * guid. In that case, we'll ultimately fail to open this consumer,
236 * but not until after setting the private field.
237 * The solution is to:
238 * 1) Don't set the private field until after the open succeeds, and
239 * 2) Set it to a linked list of vdevs, not just a single vdev
244 cp->flags |= G_CF_DIRECT_SEND | G_CF_DIRECT_RECEIVE;
249 vdev_geom_close_locked(vdev_t *vd)
252 struct g_consumer *cp;
260 ZFS_LOG(1, "Closing access to %s.", cp->provider->name);
261 KASSERT(vd->vdev_tsd == cp, ("%s: vdev_tsd is not cp", __func__));
263 vd->vdev_delayed_close = B_FALSE;
267 g_access(cp, -1, 0, -1);
268 /* Destroy consumer on last close. */
269 if (cp->acr == 0 && cp->ace == 0) {
271 g_access(cp, 0, -cp->acw, 0);
272 if (cp->provider != NULL) {
273 ZFS_LOG(1, "Destroyed consumer to %s.",
277 g_destroy_consumer(cp);
279 /* Destroy geom if there are no consumers left. */
280 if (LIST_EMPTY(&gp->consumer)) {
281 ZFS_LOG(1, "Destroyed geom %s.", gp->name);
282 g_wither_geom(gp, ENXIO);
287 nvlist_get_guids(nvlist_t *list, uint64_t *pguid, uint64_t *vguid)
290 (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_GUID, vguid);
291 (void) nvlist_lookup_uint64(list, ZPOOL_CONFIG_POOL_GUID, pguid);
295 vdev_geom_io(struct g_consumer *cp, int cmd, void *data, off_t offset, off_t size)
302 ASSERT((offset % cp->provider->sectorsize) == 0);
303 ASSERT((size % cp->provider->sectorsize) == 0);
309 maxio = MAXPHYS - (MAXPHYS % cp->provider->sectorsize);
312 for (; off < offset; off += maxio, p += maxio, size -= maxio) {
313 bzero(bp, sizeof(*bp));
316 bp->bio_offset = off;
317 bp->bio_length = MIN(size, maxio);
319 g_io_request(bp, cp);
320 error = biowait(bp, "vdev_geom_io");
330 vdev_geom_taste_orphan(struct g_consumer *cp)
333 KASSERT(1 == 0, ("%s called while tasting %s.", __func__,
334 cp->provider->name));
338 vdev_geom_read_config(struct g_consumer *cp, nvlist_t **config)
340 struct g_provider *pp;
349 g_topology_assert_not();
352 ZFS_LOG(1, "Reading config from %s...", pp->name);
354 psize = pp->mediasize;
355 psize = P2ALIGN(psize, (uint64_t)sizeof(vdev_label_t));
357 size = sizeof(*label) + pp->sectorsize -
358 ((sizeof(*label) - 1) % pp->sectorsize) - 1;
360 label = kmem_alloc(size, KM_SLEEP);
361 buflen = sizeof(label->vl_vdev_phys.vp_nvlist);
364 for (l = 0; l < VDEV_LABELS; l++) {
366 offset = vdev_label_offset(psize, l, 0);
367 if ((offset % pp->sectorsize) != 0)
370 if (vdev_geom_io(cp, BIO_READ, label, offset, size) != 0)
372 buf = label->vl_vdev_phys.vp_nvlist;
374 if (nvlist_unpack(buf, buflen, config, 0) != 0)
377 if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
378 &state) != 0 || state > POOL_STATE_L2CACHE) {
379 nvlist_free(*config);
384 if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
385 (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
386 &txg) != 0 || txg == 0)) {
387 nvlist_free(*config);
395 kmem_free(label, size);
396 return (*config == NULL ? ENOENT : 0);
400 resize_configs(nvlist_t ***configs, uint64_t *count, uint64_t id)
402 nvlist_t **new_configs;
407 new_configs = kmem_zalloc((id + 1) * sizeof(nvlist_t *),
409 for (i = 0; i < *count; i++)
410 new_configs[i] = (*configs)[i];
411 if (*configs != NULL)
412 kmem_free(*configs, *count * sizeof(void *));
413 *configs = new_configs;
418 process_vdev_config(nvlist_t ***configs, uint64_t *count, nvlist_t *cfg,
419 const char *name, uint64_t* known_pool_guid)
423 uint64_t vdev_guid, known_guid;
424 uint64_t id, txg, known_txg;
428 if (nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &pname) != 0 ||
429 strcmp(pname, name) != 0)
432 if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_GUID, &pool_guid) != 0)
435 if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_TOP_GUID, &vdev_guid) != 0)
438 if (nvlist_lookup_nvlist(cfg, ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0)
441 if (nvlist_lookup_uint64(vdev_tree, ZPOOL_CONFIG_ID, &id) != 0)
444 VERIFY(nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_TXG, &txg) == 0);
446 if (*known_pool_guid != 0) {
447 if (pool_guid != *known_pool_guid)
450 *known_pool_guid = pool_guid;
452 resize_configs(configs, count, id);
454 if ((*configs)[id] != NULL) {
455 VERIFY(nvlist_lookup_uint64((*configs)[id],
456 ZPOOL_CONFIG_POOL_TXG, &known_txg) == 0);
457 if (txg <= known_txg)
459 nvlist_free((*configs)[id]);
462 (*configs)[id] = cfg;
470 vdev_geom_attach_taster(struct g_consumer *cp, struct g_provider *pp)
474 if (pp->flags & G_PF_WITHER)
477 error = g_access(cp, 1, 0, 0);
479 if (pp->sectorsize > VDEV_PAD_SIZE || !ISP2(pp->sectorsize))
481 else if (pp->mediasize < SPA_MINDEVSIZE)
484 g_access(cp, -1, 0, 0);
492 vdev_geom_detach_taster(struct g_consumer *cp)
494 g_access(cp, -1, 0, 0);
499 vdev_geom_read_pool_label(const char *name,
500 nvlist_t ***configs, uint64_t *count)
503 struct g_geom *gp, *zgp;
504 struct g_provider *pp;
505 struct g_consumer *zcp;
513 zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste");
514 /* This orphan function should be never called. */
515 zgp->orphan = vdev_geom_taste_orphan;
516 zcp = g_new_consumer(zgp);
521 LIST_FOREACH(mp, &g_classes, class) {
522 if (mp == &zfs_vdev_class)
524 LIST_FOREACH(gp, &mp->geom, geom) {
525 if (gp->flags & G_GEOM_WITHER)
527 LIST_FOREACH(pp, &gp->provider, provider) {
528 if (pp->flags & G_PF_WITHER)
530 if (vdev_geom_attach_taster(zcp, pp) != 0)
533 error = vdev_geom_read_config(zcp, &vdev_cfg);
535 vdev_geom_detach_taster(zcp);
538 ZFS_LOG(1, "successfully read vdev config");
540 process_vdev_config(configs, count,
541 vdev_cfg, name, &pool_guid);
546 g_destroy_consumer(zcp);
551 return (*count > 0 ? 0 : ENOENT);
555 vdev_geom_read_guids(struct g_consumer *cp, uint64_t *pguid, uint64_t *vguid)
559 g_topology_assert_not();
563 if (vdev_geom_read_config(cp, &config) == 0) {
564 nvlist_get_guids(config, pguid, vguid);
569 static struct g_consumer *
570 vdev_geom_attach_by_guids(vdev_t *vd)
573 struct g_geom *gp, *zgp;
574 struct g_provider *pp;
575 struct g_consumer *cp, *zcp;
576 uint64_t pguid, vguid;
580 zgp = g_new_geomf(&zfs_vdev_class, "zfs::vdev::taste");
581 /* This orphan function should be never called. */
582 zgp->orphan = vdev_geom_taste_orphan;
583 zcp = g_new_consumer(zgp);
586 LIST_FOREACH(mp, &g_classes, class) {
587 if (mp == &zfs_vdev_class)
589 LIST_FOREACH(gp, &mp->geom, geom) {
590 if (gp->flags & G_GEOM_WITHER)
592 LIST_FOREACH(pp, &gp->provider, provider) {
593 if (vdev_geom_attach_taster(zcp, pp) != 0)
596 vdev_geom_read_guids(zcp, &pguid, &vguid);
598 vdev_geom_detach_taster(zcp);
600 * Check that the label's vdev guid matches the
601 * desired guid. If the label has a pool guid,
602 * check that it matches too. (Inactive spares
603 * and L2ARCs do not have any pool guid in the
607 pguid != spa_guid(vd->vdev_spa)) ||
608 vguid != vd->vdev_guid)
610 cp = vdev_geom_attach(pp, vd);
612 printf("ZFS WARNING: Unable to "
613 "attach to %s.\n", pp->name);
625 g_destroy_consumer(zcp);
630 static struct g_consumer *
631 vdev_geom_open_by_guids(vdev_t *vd)
633 struct g_consumer *cp;
639 ZFS_LOG(1, "Searching by guids [%ju:%ju].",
640 (uintmax_t)spa_guid(vd->vdev_spa), (uintmax_t)vd->vdev_guid);
641 cp = vdev_geom_attach_by_guids(vd);
643 len = strlen(cp->provider->name) + strlen("/dev/") + 1;
644 buf = kmem_alloc(len, KM_SLEEP);
646 snprintf(buf, len, "/dev/%s", cp->provider->name);
647 spa_strfree(vd->vdev_path);
650 ZFS_LOG(1, "Attach by guid [%ju:%ju] succeeded, provider %s.",
651 (uintmax_t)spa_guid(vd->vdev_spa),
652 (uintmax_t)vd->vdev_guid, vd->vdev_path);
654 ZFS_LOG(1, "Search by guid [%ju:%ju] failed.",
655 (uintmax_t)spa_guid(vd->vdev_spa),
656 (uintmax_t)vd->vdev_guid);
662 static struct g_consumer *
663 vdev_geom_open_by_path(vdev_t *vd, int check_guid)
665 struct g_provider *pp;
666 struct g_consumer *cp;
667 uint64_t pguid, vguid;
672 pp = g_provider_by_name(vd->vdev_path + sizeof("/dev/") - 1);
674 ZFS_LOG(1, "Found provider by name %s.", vd->vdev_path);
675 cp = vdev_geom_attach(pp, vd);
676 if (cp != NULL && check_guid && ISP2(pp->sectorsize) &&
677 pp->sectorsize <= VDEV_PAD_SIZE) {
679 vdev_geom_read_guids(cp, &pguid, &vguid);
682 * Check that the label's vdev guid matches the
683 * desired guid. If the label has a pool guid,
684 * check that it matches too. (Inactive spares
685 * and L2ARCs do not have any pool guid in the
689 pguid != spa_guid(vd->vdev_spa)) ||
690 vguid != vd->vdev_guid) {
691 vdev_geom_close_locked(vd);
693 ZFS_LOG(1, "guid mismatch for provider %s: "
694 "%ju:%ju != %ju:%ju.", vd->vdev_path,
695 (uintmax_t)spa_guid(vd->vdev_spa),
696 (uintmax_t)vd->vdev_guid,
697 (uintmax_t)pguid, (uintmax_t)vguid);
699 ZFS_LOG(1, "guid match for provider %s.",
709 vdev_geom_open(vdev_t *vd, uint64_t *psize, uint64_t *max_psize,
710 uint64_t *logical_ashift, uint64_t *physical_ashift)
712 struct g_provider *pp;
713 struct g_consumer *cp;
718 * We must have a pathname, and it must be absolute.
720 if (vd->vdev_path == NULL || vd->vdev_path[0] != '/') {
721 vd->vdev_stat.vs_aux = VDEV_AUX_BAD_LABEL;
731 if (vd->vdev_spa->spa_splitting_newspa ||
732 (vd->vdev_prevstate == VDEV_STATE_UNKNOWN &&
733 vd->vdev_spa->spa_load_state == SPA_LOAD_NONE ||
734 vd->vdev_spa->spa_load_state == SPA_LOAD_CREATE)) {
736 * We are dealing with a vdev that hasn't been previously
737 * opened (since boot), and we are not loading an
738 * existing pool configuration. This looks like a
739 * vdev add operation to a new or existing pool.
740 * Assume the user knows what he/she is doing and find
741 * GEOM provider by its name, ignoring GUID mismatches.
743 * XXPOLICY: It would be safer to only allow a device
744 * that is unlabeled or labeled but missing
745 * GUID information to be opened in this fashion,
746 * unless we are doing a split, in which case we
747 * should allow any guid.
749 cp = vdev_geom_open_by_path(vd, 0);
752 * Try using the recorded path for this device, but only
753 * accept it if its label data contains the expected GUIDs.
755 cp = vdev_geom_open_by_path(vd, 1);
758 * The device at vd->vdev_path doesn't have the
759 * expected GUIDs. The disks might have merely
760 * moved around so try all other GEOM providers
761 * to find one with the right GUIDs.
763 cp = vdev_geom_open_by_guids(vd);
768 ZFS_LOG(1, "Provider %s not found.", vd->vdev_path);
770 } else if (cp->provider->sectorsize > VDEV_PAD_SIZE ||
771 !ISP2(cp->provider->sectorsize)) {
772 ZFS_LOG(1, "Provider %s has unsupported sectorsize.",
775 vdev_geom_close_locked(vd);
778 } else if (cp->acw == 0 && (spa_mode(vd->vdev_spa) & FWRITE) != 0) {
781 for (i = 0; i < 5; i++) {
782 error = g_access(cp, 0, 1, 0);
786 tsleep(vd, 0, "vdev", hz / 2);
790 printf("ZFS WARNING: Unable to open %s for writing (error=%d).\n",
791 vd->vdev_path, error);
792 vdev_geom_close_locked(vd);
797 /* Fetch initial physical path information for this device. */
799 vdev_geom_attrchanged(cp, "GEOM::physpath");
804 vd->vdev_stat.vs_aux = VDEV_AUX_OPEN_FAILED;
810 * Determine the actual size of the device.
812 *max_psize = *psize = pp->mediasize;
815 * Determine the device's minimum transfer size and preferred
818 *logical_ashift = highbit(MAX(pp->sectorsize, SPA_MINBLOCKSIZE)) - 1;
819 *physical_ashift = 0;
820 if (pp->stripesize > (1 << *logical_ashift) && ISP2(pp->stripesize) &&
821 pp->stripesize <= (1 << SPA_MAXASHIFT) && pp->stripeoffset == 0)
822 *physical_ashift = highbit(pp->stripesize) - 1;
825 * Clear the nowritecache settings, so that on a vdev_reopen()
828 vd->vdev_nowritecache = B_FALSE;
831 * Determine the device's rotation rate.
833 vdev_geom_set_rotation_rate(vd, cp);
839 vdev_geom_close(vdev_t *vd)
844 vdev_geom_close_locked(vd);
850 vdev_geom_io_intr(struct bio *bp)
855 zio = bp->bio_caller1;
857 zio->io_error = bp->bio_error;
858 if (zio->io_error == 0 && bp->bio_resid != 0)
859 zio->io_error = SET_ERROR(EIO);
861 switch(zio->io_error) {
864 * If we get ENOTSUP for BIO_FLUSH or BIO_DELETE we know
865 * that future attempts will never succeed. In this case
866 * we set a persistent flag so that we don't bother with
867 * requests in the future.
869 switch(bp->bio_cmd) {
871 vd->vdev_nowritecache = B_TRUE;
874 vd->vdev_notrim = B_TRUE;
879 if (!vd->vdev_remove_wanted) {
881 * If provider's error is set we assume it is being
884 if (bp->bio_to->error != 0) {
885 vd->vdev_remove_wanted = B_TRUE;
886 spa_async_request(zio->io_spa,
888 } else if (!vd->vdev_delayed_close) {
889 vd->vdev_delayed_close = B_TRUE;
895 zio_delay_interrupt(zio);
899 vdev_geom_io_start(zio_t *zio)
902 struct g_consumer *cp;
908 switch (zio->io_type) {
911 if (!vdev_readable(vd)) {
912 zio->io_error = SET_ERROR(ENXIO);
916 switch (zio->io_cmd) {
917 case DKIOCFLUSHWRITECACHE:
918 if (zfs_nocacheflush || vdev_geom_bio_flush_disable)
920 if (vd->vdev_nowritecache) {
921 zio->io_error = SET_ERROR(ENOTSUP);
926 zio->io_error = SET_ERROR(ENOTSUP);
933 if (vd->vdev_notrim) {
934 zio->io_error = SET_ERROR(ENOTSUP);
935 } else if (!vdev_geom_bio_delete_disable) {
942 ASSERT(zio->io_type == ZIO_TYPE_READ ||
943 zio->io_type == ZIO_TYPE_WRITE ||
944 zio->io_type == ZIO_TYPE_FREE ||
945 zio->io_type == ZIO_TYPE_IOCTL);
949 zio->io_error = SET_ERROR(ENXIO);
954 bp->bio_caller1 = zio;
955 switch (zio->io_type) {
958 zio->io_target_timestamp = zio_handle_io_delay(zio);
959 bp->bio_cmd = zio->io_type == ZIO_TYPE_READ ? BIO_READ : BIO_WRITE;
960 bp->bio_data = zio->io_data;
961 bp->bio_offset = zio->io_offset;
962 bp->bio_length = zio->io_size;
965 bp->bio_cmd = BIO_DELETE;
967 bp->bio_offset = zio->io_offset;
968 bp->bio_length = zio->io_size;
971 bp->bio_cmd = BIO_FLUSH;
972 bp->bio_flags |= BIO_ORDERED;
974 bp->bio_offset = cp->provider->mediasize;
978 bp->bio_done = vdev_geom_io_intr;
980 g_io_request(bp, cp);
984 vdev_geom_io_done(zio_t *zio)
989 vdev_geom_hold(vdev_t *vd)
994 vdev_geom_rele(vdev_t *vd)
998 vdev_ops_t vdev_geom_ops = {
1007 VDEV_TYPE_DISK, /* name of this vdev type */
1008 B_TRUE /* leaf vdev */