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) 2008-2010 Lawrence Livermore National Security, LLC.
23 * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
24 * Rewritten for Linux by Brian Behlendorf <behlendorf1@llnl.gov>.
26 * Copyright (c) 2012, 2015 by Delphix. All rights reserved.
29 #include <sys/zfs_context.h>
30 #include <sys/spa_impl.h>
31 #include <sys/vdev_disk.h>
32 #include <sys/vdev_impl.h>
34 #include <sys/fs/zfs.h>
36 #include <sys/sunldi.h>
37 #include <linux/mod_compat.h>
39 char *zfs_vdev_scheduler
= VDEV_SCHEDULER
;
40 static void *zfs_vdev_holder
= VDEV_HOLDER
;
43 * Virtual device vector for disks.
45 typedef struct dio_request
{
46 zio_t
*dr_zio
; /* Parent ZIO */
47 atomic_t dr_ref
; /* References */
48 int dr_error
; /* Bio error */
49 int dr_bio_count
; /* Count of bio's */
50 struct bio
*dr_bio
[0]; /* Attached bio's */
54 #ifdef HAVE_OPEN_BDEV_EXCLUSIVE
56 vdev_bdev_mode(int smode
)
60 ASSERT3S(smode
& (FREAD
| FWRITE
), !=, 0);
72 vdev_bdev_mode(int smode
)
76 ASSERT3S(smode
& (FREAD
| FWRITE
), !=, 0);
78 if ((smode
& FREAD
) && !(smode
& FWRITE
))
83 #endif /* HAVE_OPEN_BDEV_EXCLUSIVE */
86 bdev_capacity(struct block_device
*bdev
)
88 struct hd_struct
*part
= bdev
->bd_part
;
90 /* The partition capacity referenced by the block device */
92 return (part
->nr_sects
<< 9);
94 /* Otherwise assume the full device capacity */
95 return (get_capacity(bdev
->bd_disk
) << 9);
99 vdev_disk_error(zio_t
*zio
)
102 printk(KERN_WARNING
"ZFS: zio error=%d type=%d offset=%llu size=%llu "
103 "flags=%x\n", zio
->io_error
, zio
->io_type
,
104 (u_longlong_t
)zio
->io_offset
, (u_longlong_t
)zio
->io_size
,
110 * Use the Linux 'noop' elevator for zfs managed block devices. This
111 * strikes the ideal balance by allowing the zfs elevator to do all
112 * request ordering and prioritization. While allowing the Linux
113 * elevator to do the maximum front/back merging allowed by the
114 * physical device. This yields the largest possible requests for
115 * the device with the lowest total overhead.
118 vdev_elevator_switch(vdev_t
*v
, char *elevator
)
120 vdev_disk_t
*vd
= v
->vdev_tsd
;
121 struct request_queue
*q
;
125 for (int c
= 0; c
< v
->vdev_children
; c
++)
126 vdev_elevator_switch(v
->vdev_child
[c
], elevator
);
128 if (!v
->vdev_ops
->vdev_op_leaf
|| vd
->vd_bdev
== NULL
)
131 q
= bdev_get_queue(vd
->vd_bdev
);
132 device
= vd
->vd_bdev
->bd_disk
->disk_name
;
135 * Skip devices which are not whole disks (partitions).
136 * Device-mapper devices are excepted since they may be whole
137 * disks despite the vdev_wholedisk flag, in which case we can
138 * and should switch the elevator. If the device-mapper device
139 * does not have an elevator (i.e. dm-raid, dm-crypt, etc.) the
140 * "Skip devices without schedulers" check below will fail.
142 if (!v
->vdev_wholedisk
&& strncmp(device
, "dm-", 3) != 0)
145 /* Skip devices without schedulers (loop, ram, dm, etc) */
146 if (!q
->elevator
|| !blk_queue_stackable(q
))
149 /* Leave existing scheduler when set to "none" */
150 if ((strncmp(elevator
, "none", 4) == 0) && (strlen(elevator
) == 4))
153 #ifdef HAVE_ELEVATOR_CHANGE
154 error
= elevator_change(q
, elevator
);
157 * For pre-2.6.36 kernels elevator_change() is not available.
158 * Therefore we fall back to using a usermodehelper to echo the
159 * elevator into sysfs; This requires /bin/echo and sysfs to be
160 * mounted which may not be true early in the boot process.
162 #define SET_SCHEDULER_CMD \
163 "exec 0</dev/null " \
164 " 1>/sys/block/%s/queue/scheduler " \
168 char *argv
[] = { "/bin/sh", "-c", NULL
, NULL
};
169 char *envp
[] = { NULL
};
171 argv
[2] = kmem_asprintf(SET_SCHEDULER_CMD
, device
, elevator
);
172 error
= call_usermodehelper(argv
[0], argv
, envp
, UMH_WAIT_PROC
);
174 #endif /* HAVE_ELEVATOR_CHANGE */
176 printk(KERN_NOTICE
"ZFS: Unable to set \"%s\" scheduler"
177 " for %s (%s): %d\n", elevator
, v
->vdev_path
, device
,
182 * Expanding a whole disk vdev involves invoking BLKRRPART on the
183 * whole disk device. This poses a problem, because BLKRRPART will
184 * return EBUSY if one of the disk's partitions is open. That's why
185 * we have to do it here, just before opening the data partition.
186 * Unfortunately, BLKRRPART works by dropping all partitions and
187 * recreating them, which means that for a short time window, all
188 * /dev/sdxN device files disappear (until udev recreates them).
189 * This means two things:
190 * - When we open the data partition just after a BLKRRPART, we
191 * can't do it using the normal device file path because of the
192 * obvious race condition with udev. Instead, we use reliable
193 * kernel APIs to get a handle to the new partition device from
194 * the whole disk device.
195 * - Because vdev_disk_open() initially needs to find the device
196 * using its path, multiple vdev_disk_open() invocations in
197 * short succession on the same disk with BLKRRPARTs in the
198 * middle have a high probability of failure (because of the
199 * race condition with udev). A typical situation where this
200 * might happen is when the zpool userspace tool does a
201 * TRYIMPORT immediately followed by an IMPORT. For this
202 * reason, we only invoke BLKRRPART in the module when strictly
203 * necessary (zpool online -e case), and rely on userspace to
204 * do it when possible.
206 static struct block_device
*
207 vdev_disk_rrpart(const char *path
, int mode
, vdev_disk_t
*vd
)
209 #if defined(HAVE_3ARG_BLKDEV_GET) && defined(HAVE_GET_GENDISK)
210 struct block_device
*bdev
, *result
= ERR_PTR(-ENXIO
);
211 struct gendisk
*disk
;
214 bdev
= vdev_bdev_open(path
, vdev_bdev_mode(mode
), zfs_vdev_holder
);
218 disk
= get_gendisk(bdev
->bd_dev
, &partno
);
219 vdev_bdev_close(bdev
, vdev_bdev_mode(mode
));
222 bdev
= bdget(disk_devt(disk
));
224 error
= blkdev_get(bdev
, vdev_bdev_mode(mode
), vd
);
226 error
= ioctl_by_bdev(bdev
, BLKRRPART
, 0);
227 vdev_bdev_close(bdev
, vdev_bdev_mode(mode
));
230 bdev
= bdget_disk(disk
, partno
);
232 error
= blkdev_get(bdev
,
233 vdev_bdev_mode(mode
) | FMODE_EXCL
, vd
);
242 return (ERR_PTR(-EOPNOTSUPP
));
243 #endif /* defined(HAVE_3ARG_BLKDEV_GET) && defined(HAVE_GET_GENDISK) */
247 vdev_disk_open(vdev_t
*v
, uint64_t *psize
, uint64_t *max_psize
,
250 struct block_device
*bdev
= ERR_PTR(-ENXIO
);
252 int count
= 0, mode
, block_size
;
254 /* Must have a pathname and it must be absolute. */
255 if (v
->vdev_path
== NULL
|| v
->vdev_path
[0] != '/') {
256 v
->vdev_stat
.vs_aux
= VDEV_AUX_BAD_LABEL
;
257 return (SET_ERROR(EINVAL
));
261 * Reopen the device if it's not currently open. Otherwise,
262 * just update the physical size of the device.
264 if (v
->vdev_tsd
!= NULL
) {
265 ASSERT(v
->vdev_reopening
);
270 vd
= kmem_zalloc(sizeof (vdev_disk_t
), KM_SLEEP
);
272 return (SET_ERROR(ENOMEM
));
275 * Devices are always opened by the path provided at configuration
276 * time. This means that if the provided path is a udev by-id path
277 * then drives may be recabled without an issue. If the provided
278 * path is a udev by-path path, then the physical location information
279 * will be preserved. This can be critical for more complicated
280 * configurations where drives are located in specific physical
281 * locations to maximize the systems tolerence to component failure.
282 * Alternatively, you can provide your own udev rule to flexibly map
283 * the drives as you see fit. It is not advised that you use the
284 * /dev/[hd]d devices which may be reordered due to probing order.
285 * Devices in the wrong locations will be detected by the higher
286 * level vdev validation.
288 * The specified paths may be briefly removed and recreated in
289 * response to udev events. This should be exceptionally unlikely
290 * because the zpool command makes every effort to verify these paths
291 * have already settled prior to reaching this point. Therefore,
292 * a ENOENT failure at this point is highly likely to be transient
293 * and it is reasonable to sleep and retry before giving up. In
294 * practice delays have been observed to be on the order of 100ms.
296 mode
= spa_mode(v
->vdev_spa
);
297 if (v
->vdev_wholedisk
&& v
->vdev_expanding
)
298 bdev
= vdev_disk_rrpart(v
->vdev_path
, mode
, vd
);
300 while (IS_ERR(bdev
) && count
< 50) {
301 bdev
= vdev_bdev_open(v
->vdev_path
,
302 vdev_bdev_mode(mode
), zfs_vdev_holder
);
303 if (unlikely(PTR_ERR(bdev
) == -ENOENT
)) {
306 } else if (IS_ERR(bdev
)) {
312 dprintf("failed open v->vdev_path=%s, error=%d count=%d\n",
313 v
->vdev_path
, -PTR_ERR(bdev
), count
);
314 kmem_free(vd
, sizeof (vdev_disk_t
));
315 return (SET_ERROR(-PTR_ERR(bdev
)));
322 /* Determine the physical block size */
323 block_size
= vdev_bdev_block_size(vd
->vd_bdev
);
325 /* Clear the nowritecache bit, causes vdev_reopen() to try again. */
326 v
->vdev_nowritecache
= B_FALSE
;
328 /* Inform the ZIO pipeline that we are non-rotational */
329 v
->vdev_nonrot
= blk_queue_nonrot(bdev_get_queue(vd
->vd_bdev
));
331 /* Physical volume size in bytes */
332 *psize
= bdev_capacity(vd
->vd_bdev
);
334 /* TODO: report possible expansion size */
337 /* Based on the minimum sector size set the block size */
338 *ashift
= highbit64(MAX(block_size
, SPA_MINBLOCKSIZE
)) - 1;
340 /* Try to set the io scheduler elevator algorithm */
341 (void) vdev_elevator_switch(v
, zfs_vdev_scheduler
);
347 vdev_disk_close(vdev_t
*v
)
349 vdev_disk_t
*vd
= v
->vdev_tsd
;
351 if (v
->vdev_reopening
|| vd
== NULL
)
354 if (vd
->vd_bdev
!= NULL
)
355 vdev_bdev_close(vd
->vd_bdev
,
356 vdev_bdev_mode(spa_mode(v
->vdev_spa
)));
358 kmem_free(vd
, sizeof (vdev_disk_t
));
362 static dio_request_t
*
363 vdev_disk_dio_alloc(int bio_count
)
368 dr
= kmem_zalloc(sizeof (dio_request_t
) +
369 sizeof (struct bio
*) * bio_count
, KM_SLEEP
);
371 atomic_set(&dr
->dr_ref
, 0);
372 dr
->dr_bio_count
= bio_count
;
375 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
376 dr
->dr_bio
[i
] = NULL
;
383 vdev_disk_dio_free(dio_request_t
*dr
)
387 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
389 bio_put(dr
->dr_bio
[i
]);
391 kmem_free(dr
, sizeof (dio_request_t
) +
392 sizeof (struct bio
*) * dr
->dr_bio_count
);
396 vdev_disk_dio_get(dio_request_t
*dr
)
398 atomic_inc(&dr
->dr_ref
);
402 vdev_disk_dio_put(dio_request_t
*dr
)
404 int rc
= atomic_dec_return(&dr
->dr_ref
);
407 * Free the dio_request when the last reference is dropped and
408 * ensure zio_interpret is called only once with the correct zio
411 zio_t
*zio
= dr
->dr_zio
;
412 int error
= dr
->dr_error
;
414 vdev_disk_dio_free(dr
);
417 zio
->io_error
= error
;
418 ASSERT3S(zio
->io_error
, >=, 0);
420 vdev_disk_error(zio
);
422 zio_delay_interrupt(zio
);
429 BIO_END_IO_PROTO(vdev_disk_physio_completion
, bio
, error
)
431 dio_request_t
*dr
= bio
->bi_private
;
434 if (dr
->dr_error
== 0) {
435 #ifdef HAVE_1ARG_BIO_END_IO_T
436 dr
->dr_error
= BIO_END_IO_ERROR(bio
);
439 dr
->dr_error
= -(error
);
440 else if (!test_bit(BIO_UPTODATE
, &bio
->bi_flags
))
445 /* Drop reference acquired by __vdev_disk_physio */
446 rc
= vdev_disk_dio_put(dr
);
450 bio_map(struct bio
*bio
, void *bio_ptr
, unsigned int bio_size
)
452 unsigned int offset
, size
, i
;
455 offset
= offset_in_page(bio_ptr
);
456 for (i
= 0; i
< bio
->bi_max_vecs
; i
++) {
457 size
= PAGE_SIZE
- offset
;
465 if (is_vmalloc_addr(bio_ptr
))
466 page
= vmalloc_to_page(bio_ptr
);
468 page
= virt_to_page(bio_ptr
);
471 * Some network related block device uses tcp_sendpage, which
472 * doesn't behave well when using 0-count page, this is a
473 * safety net to catch them.
475 ASSERT3S(page_count(page
), >, 0);
477 if (bio_add_page(bio
, page
, size
, offset
) != size
)
489 bio_map_abd_off(struct bio
*bio
, abd_t
*abd
, unsigned int size
, size_t off
)
491 if (abd_is_linear(abd
))
492 return (bio_map(bio
, ((char *)abd_to_buf(abd
)) + off
, size
));
494 return (abd_scatter_bio_map_off(bio
, abd
, size
, off
));
498 vdev_submit_bio_impl(struct bio
*bio
)
500 #ifdef HAVE_1ARG_SUBMIT_BIO
507 #ifndef HAVE_BIO_SET_DEV
509 bio_set_dev(struct bio
*bio
, struct block_device
*bdev
)
513 #endif /* !HAVE_BIO_SET_DEV */
516 vdev_submit_bio(struct bio
*bio
)
518 #ifdef HAVE_CURRENT_BIO_TAIL
519 struct bio
**bio_tail
= current
->bio_tail
;
520 current
->bio_tail
= NULL
;
521 vdev_submit_bio_impl(bio
);
522 current
->bio_tail
= bio_tail
;
524 struct bio_list
*bio_list
= current
->bio_list
;
525 current
->bio_list
= NULL
;
526 vdev_submit_bio_impl(bio
);
527 current
->bio_list
= bio_list
;
532 __vdev_disk_physio(struct block_device
*bdev
, zio_t
*zio
,
533 size_t io_size
, uint64_t io_offset
, int rw
, int flags
)
538 int bio_size
, bio_count
= 16;
539 int i
= 0, error
= 0;
540 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
541 struct blk_plug plug
;
545 ASSERT3U(io_offset
+ io_size
, <=, bdev
->bd_inode
->i_size
);
548 dr
= vdev_disk_dio_alloc(bio_count
);
550 return (SET_ERROR(ENOMEM
));
552 if (zio
&& !(zio
->io_flags
& (ZIO_FLAG_IO_RETRY
| ZIO_FLAG_TRYHARD
)))
553 bio_set_flags_failfast(bdev
, &flags
);
558 * When the IO size exceeds the maximum bio size for the request
559 * queue we are forced to break the IO in multiple bio's and wait
560 * for them all to complete. Ideally, all pool users will set
561 * their volume block size to match the maximum request size and
562 * the common case will be one bio per vdev IO request.
566 bio_offset
= io_offset
;
568 for (i
= 0; i
<= dr
->dr_bio_count
; i
++) {
570 /* Finished constructing bio's for given buffer */
575 * By default only 'bio_count' bio's per dio are allowed.
576 * However, if we find ourselves in a situation where more
577 * are needed we allocate a larger dio and warn the user.
579 if (dr
->dr_bio_count
== i
) {
580 vdev_disk_dio_free(dr
);
585 /* bio_alloc() with __GFP_WAIT never returns NULL */
586 dr
->dr_bio
[i
] = bio_alloc(GFP_NOIO
,
587 MIN(abd_nr_pages_off(zio
->io_abd
, bio_size
, abd_offset
),
589 if (unlikely(dr
->dr_bio
[i
] == NULL
)) {
590 vdev_disk_dio_free(dr
);
591 return (SET_ERROR(ENOMEM
));
594 /* Matching put called by vdev_disk_physio_completion */
595 vdev_disk_dio_get(dr
);
597 bio_set_dev(dr
->dr_bio
[i
], bdev
);
598 BIO_BI_SECTOR(dr
->dr_bio
[i
]) = bio_offset
>> 9;
599 dr
->dr_bio
[i
]->bi_end_io
= vdev_disk_physio_completion
;
600 dr
->dr_bio
[i
]->bi_private
= dr
;
601 bio_set_op_attrs(dr
->dr_bio
[i
], rw
, flags
);
603 /* Remaining size is returned to become the new size */
604 bio_size
= bio_map_abd_off(dr
->dr_bio
[i
], zio
->io_abd
,
605 bio_size
, abd_offset
);
607 /* Advance in buffer and construct another bio if needed */
608 abd_offset
+= BIO_BI_SIZE(dr
->dr_bio
[i
]);
609 bio_offset
+= BIO_BI_SIZE(dr
->dr_bio
[i
]);
612 /* Extra reference to protect dio_request during vdev_submit_bio */
613 vdev_disk_dio_get(dr
);
615 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
616 if (dr
->dr_bio_count
> 1)
617 blk_start_plug(&plug
);
620 /* Submit all bio's associated with this dio */
621 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
623 vdev_submit_bio(dr
->dr_bio
[i
]);
625 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
626 if (dr
->dr_bio_count
> 1)
627 blk_finish_plug(&plug
);
630 (void) vdev_disk_dio_put(dr
);
635 BIO_END_IO_PROTO(vdev_disk_io_flush_completion
, bio
, error
)
637 zio_t
*zio
= bio
->bi_private
;
638 #ifdef HAVE_1ARG_BIO_END_IO_T
639 zio
->io_error
= BIO_END_IO_ERROR(bio
);
641 zio
->io_error
= -error
;
644 if (zio
->io_error
&& (zio
->io_error
== EOPNOTSUPP
))
645 zio
->io_vd
->vdev_nowritecache
= B_TRUE
;
648 ASSERT3S(zio
->io_error
, >=, 0);
650 vdev_disk_error(zio
);
655 vdev_disk_io_flush(struct block_device
*bdev
, zio_t
*zio
)
657 struct request_queue
*q
;
660 q
= bdev_get_queue(bdev
);
662 return (SET_ERROR(ENXIO
));
664 bio
= bio_alloc(GFP_NOIO
, 0);
665 /* bio_alloc() with __GFP_WAIT never returns NULL */
666 if (unlikely(bio
== NULL
))
667 return (SET_ERROR(ENOMEM
));
669 bio
->bi_end_io
= vdev_disk_io_flush_completion
;
670 bio
->bi_private
= zio
;
671 bio_set_dev(bio
, bdev
);
673 vdev_submit_bio(bio
);
674 invalidate_bdev(bdev
);
680 vdev_disk_io_start(zio_t
*zio
)
682 vdev_t
*v
= zio
->io_vd
;
683 vdev_disk_t
*vd
= v
->vdev_tsd
;
684 int rw
, flags
, error
;
686 switch (zio
->io_type
) {
689 if (!vdev_readable(v
)) {
690 zio
->io_error
= SET_ERROR(ENXIO
);
695 switch (zio
->io_cmd
) {
696 case DKIOCFLUSHWRITECACHE
:
698 if (zfs_nocacheflush
)
701 if (v
->vdev_nowritecache
) {
702 zio
->io_error
= SET_ERROR(ENOTSUP
);
706 error
= vdev_disk_io_flush(vd
->vd_bdev
, zio
);
710 zio
->io_error
= error
;
715 zio
->io_error
= SET_ERROR(ENOTSUP
);
722 #if defined(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG)
723 flags
= (1 << BIO_RW_UNPLUG
);
724 #elif defined(REQ_UNPLUG)
733 #if defined(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG)
734 flags
= (1 << BIO_RW_UNPLUG
);
735 #elif defined(REQ_UNPLUG)
743 zio
->io_error
= SET_ERROR(ENOTSUP
);
748 zio
->io_target_timestamp
= zio_handle_io_delay(zio
);
749 error
= __vdev_disk_physio(vd
->vd_bdev
, zio
,
750 zio
->io_size
, zio
->io_offset
, rw
, flags
);
752 zio
->io_error
= error
;
759 vdev_disk_io_done(zio_t
*zio
)
762 * If the device returned EIO, we revalidate the media. If it is
763 * determined the media has changed this triggers the asynchronous
764 * removal of the device from the configuration.
766 if (zio
->io_error
== EIO
) {
767 vdev_t
*v
= zio
->io_vd
;
768 vdev_disk_t
*vd
= v
->vdev_tsd
;
770 if (check_disk_change(vd
->vd_bdev
)) {
771 vdev_bdev_invalidate(vd
->vd_bdev
);
772 v
->vdev_remove_wanted
= B_TRUE
;
773 spa_async_request(zio
->io_spa
, SPA_ASYNC_REMOVE
);
779 vdev_disk_hold(vdev_t
*vd
)
781 ASSERT(spa_config_held(vd
->vdev_spa
, SCL_STATE
, RW_WRITER
));
783 /* We must have a pathname, and it must be absolute. */
784 if (vd
->vdev_path
== NULL
|| vd
->vdev_path
[0] != '/')
788 * Only prefetch path and devid info if the device has
791 if (vd
->vdev_tsd
!= NULL
)
794 /* XXX: Implement me as a vnode lookup for the device */
795 vd
->vdev_name_vp
= NULL
;
796 vd
->vdev_devid_vp
= NULL
;
800 vdev_disk_rele(vdev_t
*vd
)
802 ASSERT(spa_config_held(vd
->vdev_spa
, SCL_STATE
, RW_WRITER
));
804 /* XXX: Implement me as a vnode rele for the device */
808 param_set_vdev_scheduler(const char *val
, zfs_kernel_param_t
*kp
)
814 return (SET_ERROR(-EINVAL
));
816 if ((p
= strchr(val
, '\n')) != NULL
)
819 mutex_enter(&spa_namespace_lock
);
820 while ((spa
= spa_next(spa
)) != NULL
) {
821 if (spa_state(spa
) != POOL_STATE_ACTIVE
||
822 !spa_writeable(spa
) || spa_suspended(spa
))
825 spa_open_ref(spa
, FTAG
);
826 mutex_exit(&spa_namespace_lock
);
827 vdev_elevator_switch(spa
->spa_root_vdev
, (char *)val
);
828 mutex_enter(&spa_namespace_lock
);
829 spa_close(spa
, FTAG
);
831 mutex_exit(&spa_namespace_lock
);
833 return (param_set_charp(val
, kp
));
836 vdev_ops_t vdev_disk_ops
= {
847 VDEV_TYPE_DISK
, /* name of this vdev type */
848 B_TRUE
/* leaf vdev */
851 module_param_call(zfs_vdev_scheduler
, param_set_vdev_scheduler
,
852 param_get_charp
, &zfs_vdev_scheduler
, 0644);
853 MODULE_PARM_DESC(zfs_vdev_scheduler
, "I/O scheduler");