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>
38 #include <linux/vfs_compat.h>
40 char *zfs_vdev_scheduler
= VDEV_SCHEDULER
;
41 static void *zfs_vdev_holder
= VDEV_HOLDER
;
44 * Virtual device vector for disks.
46 typedef struct dio_request
{
47 zio_t
*dr_zio
; /* Parent ZIO */
48 atomic_t dr_ref
; /* References */
49 int dr_error
; /* Bio error */
50 int dr_bio_count
; /* Count of bio's */
51 struct bio
*dr_bio
[0]; /* Attached bio's */
55 #ifdef HAVE_OPEN_BDEV_EXCLUSIVE
57 vdev_bdev_mode(int smode
)
61 ASSERT3S(smode
& (FREAD
| FWRITE
), !=, 0);
73 vdev_bdev_mode(int smode
)
77 ASSERT3S(smode
& (FREAD
| FWRITE
), !=, 0);
79 if ((smode
& FREAD
) && !(smode
& FWRITE
))
84 #endif /* HAVE_OPEN_BDEV_EXCLUSIVE */
87 bdev_capacity(struct block_device
*bdev
)
89 struct hd_struct
*part
= bdev
->bd_part
;
91 /* The partition capacity referenced by the block device */
93 return (part
->nr_sects
<< 9);
95 /* Otherwise assume the full device capacity */
96 return (get_capacity(bdev
->bd_disk
) << 9);
100 vdev_disk_error(zio_t
*zio
)
103 printk("ZFS: zio error=%d type=%d offset=%llu size=%llu "
104 "flags=%x\n", zio
->io_error
, zio
->io_type
,
105 (u_longlong_t
)zio
->io_offset
, (u_longlong_t
)zio
->io_size
,
111 * Use the Linux 'noop' elevator for zfs managed block devices. This
112 * strikes the ideal balance by allowing the zfs elevator to do all
113 * request ordering and prioritization. While allowing the Linux
114 * elevator to do the maximum front/back merging allowed by the
115 * physical device. This yields the largest possible requests for
116 * the device with the lowest total overhead.
119 vdev_elevator_switch(vdev_t
*v
, char *elevator
)
121 vdev_disk_t
*vd
= v
->vdev_tsd
;
122 struct request_queue
*q
;
126 for (int c
= 0; c
< v
->vdev_children
; c
++)
127 vdev_elevator_switch(v
->vdev_child
[c
], elevator
);
129 if (!v
->vdev_ops
->vdev_op_leaf
|| vd
->vd_bdev
== NULL
)
132 q
= bdev_get_queue(vd
->vd_bdev
);
133 device
= vd
->vd_bdev
->bd_disk
->disk_name
;
136 * Skip devices which are not whole disks (partitions).
137 * Device-mapper devices are excepted since they may be whole
138 * disks despite the vdev_wholedisk flag, in which case we can
139 * and should switch the elevator. If the device-mapper device
140 * does not have an elevator (i.e. dm-raid, dm-crypt, etc.) the
141 * "Skip devices without schedulers" check below will fail.
143 if (!v
->vdev_wholedisk
&& strncmp(device
, "dm-", 3) != 0)
146 /* Leave existing scheduler when set to "none" */
147 if ((strncmp(elevator
, "none", 4) == 0) && (strlen(elevator
) == 4))
151 * The elevator_change() function was available in kernels from
152 * 2.6.36 to 4.11. When not available fall back to using the user
153 * mode helper functionality to set the elevator via sysfs. This
154 * requires /bin/echo and sysfs to be mounted which may not be true
155 * early in the boot process.
157 #ifdef HAVE_ELEVATOR_CHANGE
158 error
= elevator_change(q
, elevator
);
160 #define SET_SCHEDULER_CMD \
161 "exec 0</dev/null " \
162 " 1>/sys/block/%s/queue/scheduler " \
166 char *argv
[] = { "/bin/sh", "-c", NULL
, NULL
};
167 char *envp
[] = { NULL
};
169 argv
[2] = kmem_asprintf(SET_SCHEDULER_CMD
, device
, elevator
);
170 error
= call_usermodehelper(argv
[0], argv
, envp
, UMH_WAIT_PROC
);
172 #endif /* HAVE_ELEVATOR_CHANGE */
174 zfs_dbgmsg("Unable to set \"%s\" scheduler for %s (%s): %d\n",
175 elevator
, v
->vdev_path
, device
, error
);
180 * Expanding a whole disk vdev involves invoking BLKRRPART on the
181 * whole disk device. This poses a problem, because BLKRRPART will
182 * return EBUSY if one of the disk's partitions is open. That's why
183 * we have to do it here, just before opening the data partition.
184 * Unfortunately, BLKRRPART works by dropping all partitions and
185 * recreating them, which means that for a short time window, all
186 * /dev/sdxN device files disappear (until udev recreates them).
187 * This means two things:
188 * - When we open the data partition just after a BLKRRPART, we
189 * can't do it using the normal device file path because of the
190 * obvious race condition with udev. Instead, we use reliable
191 * kernel APIs to get a handle to the new partition device from
192 * the whole disk device.
193 * - Because vdev_disk_open() initially needs to find the device
194 * using its path, multiple vdev_disk_open() invocations in
195 * short succession on the same disk with BLKRRPARTs in the
196 * middle have a high probability of failure (because of the
197 * race condition with udev). A typical situation where this
198 * might happen is when the zpool userspace tool does a
199 * TRYIMPORT immediately followed by an IMPORT. For this
200 * reason, we only invoke BLKRRPART in the module when strictly
201 * necessary (zpool online -e case), and rely on userspace to
202 * do it when possible.
204 static struct block_device
*
205 vdev_disk_rrpart(const char *path
, int mode
, vdev_disk_t
*vd
)
207 #if defined(HAVE_3ARG_BLKDEV_GET) && defined(HAVE_GET_GENDISK)
208 struct block_device
*bdev
, *result
= ERR_PTR(-ENXIO
);
209 struct gendisk
*disk
;
212 bdev
= vdev_bdev_open(path
, vdev_bdev_mode(mode
), zfs_vdev_holder
);
216 disk
= get_gendisk(bdev
->bd_dev
, &partno
);
217 vdev_bdev_close(bdev
, vdev_bdev_mode(mode
));
220 bdev
= bdget(disk_devt(disk
));
222 error
= blkdev_get(bdev
, vdev_bdev_mode(mode
), vd
);
224 error
= ioctl_by_bdev(bdev
, BLKRRPART
, 0);
225 vdev_bdev_close(bdev
, vdev_bdev_mode(mode
));
228 bdev
= bdget_disk(disk
, partno
);
230 error
= blkdev_get(bdev
,
231 vdev_bdev_mode(mode
) | FMODE_EXCL
, vd
);
240 return (ERR_PTR(-EOPNOTSUPP
));
241 #endif /* defined(HAVE_3ARG_BLKDEV_GET) && defined(HAVE_GET_GENDISK) */
245 vdev_disk_open(vdev_t
*v
, uint64_t *psize
, uint64_t *max_psize
,
248 struct block_device
*bdev
= ERR_PTR(-ENXIO
);
250 int count
= 0, mode
, block_size
;
252 /* Must have a pathname and it must be absolute. */
253 if (v
->vdev_path
== NULL
|| v
->vdev_path
[0] != '/') {
254 v
->vdev_stat
.vs_aux
= VDEV_AUX_BAD_LABEL
;
255 return (SET_ERROR(EINVAL
));
259 * Reopen the device if it's not currently open. Otherwise,
260 * just update the physical size of the device.
262 if (v
->vdev_tsd
!= NULL
) {
263 ASSERT(v
->vdev_reopening
);
268 vd
= kmem_zalloc(sizeof (vdev_disk_t
), KM_SLEEP
);
270 return (SET_ERROR(ENOMEM
));
273 * Devices are always opened by the path provided at configuration
274 * time. This means that if the provided path is a udev by-id path
275 * then drives may be recabled without an issue. If the provided
276 * path is a udev by-path path, then the physical location information
277 * will be preserved. This can be critical for more complicated
278 * configurations where drives are located in specific physical
279 * locations to maximize the systems tolerence to component failure.
280 * Alternatively, you can provide your own udev rule to flexibly map
281 * the drives as you see fit. It is not advised that you use the
282 * /dev/[hd]d devices which may be reordered due to probing order.
283 * Devices in the wrong locations will be detected by the higher
284 * level vdev validation.
286 * The specified paths may be briefly removed and recreated in
287 * response to udev events. This should be exceptionally unlikely
288 * because the zpool command makes every effort to verify these paths
289 * have already settled prior to reaching this point. Therefore,
290 * a ENOENT failure at this point is highly likely to be transient
291 * and it is reasonable to sleep and retry before giving up. In
292 * practice delays have been observed to be on the order of 100ms.
294 mode
= spa_mode(v
->vdev_spa
);
295 if (v
->vdev_wholedisk
&& v
->vdev_expanding
)
296 bdev
= vdev_disk_rrpart(v
->vdev_path
, mode
, vd
);
298 while (IS_ERR(bdev
) && count
< 50) {
299 bdev
= vdev_bdev_open(v
->vdev_path
,
300 vdev_bdev_mode(mode
), zfs_vdev_holder
);
301 if (unlikely(PTR_ERR(bdev
) == -ENOENT
)) {
304 } else if (IS_ERR(bdev
)) {
310 dprintf("failed open v->vdev_path=%s, error=%d count=%d\n",
311 v
->vdev_path
, -PTR_ERR(bdev
), count
);
312 kmem_free(vd
, sizeof (vdev_disk_t
));
313 return (SET_ERROR(-PTR_ERR(bdev
)));
320 /* Determine the physical block size */
321 block_size
= vdev_bdev_block_size(vd
->vd_bdev
);
323 /* Clear the nowritecache bit, causes vdev_reopen() to try again. */
324 v
->vdev_nowritecache
= B_FALSE
;
326 /* Inform the ZIO pipeline that we are non-rotational */
327 v
->vdev_nonrot
= blk_queue_nonrot(bdev_get_queue(vd
->vd_bdev
));
329 /* Physical volume size in bytes */
330 *psize
= bdev_capacity(vd
->vd_bdev
);
332 /* TODO: report possible expansion size */
335 /* Based on the minimum sector size set the block size */
336 *ashift
= highbit64(MAX(block_size
, SPA_MINBLOCKSIZE
)) - 1;
338 /* Try to set the io scheduler elevator algorithm */
339 (void) vdev_elevator_switch(v
, zfs_vdev_scheduler
);
345 vdev_disk_close(vdev_t
*v
)
347 vdev_disk_t
*vd
= v
->vdev_tsd
;
349 if (v
->vdev_reopening
|| vd
== NULL
)
352 if (vd
->vd_bdev
!= NULL
)
353 vdev_bdev_close(vd
->vd_bdev
,
354 vdev_bdev_mode(spa_mode(v
->vdev_spa
)));
356 kmem_free(vd
, sizeof (vdev_disk_t
));
360 static dio_request_t
*
361 vdev_disk_dio_alloc(int bio_count
)
366 dr
= kmem_zalloc(sizeof (dio_request_t
) +
367 sizeof (struct bio
*) * bio_count
, KM_SLEEP
);
369 atomic_set(&dr
->dr_ref
, 0);
370 dr
->dr_bio_count
= bio_count
;
373 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
374 dr
->dr_bio
[i
] = NULL
;
381 vdev_disk_dio_free(dio_request_t
*dr
)
385 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
387 bio_put(dr
->dr_bio
[i
]);
389 kmem_free(dr
, sizeof (dio_request_t
) +
390 sizeof (struct bio
*) * dr
->dr_bio_count
);
394 vdev_disk_dio_get(dio_request_t
*dr
)
396 atomic_inc(&dr
->dr_ref
);
400 vdev_disk_dio_put(dio_request_t
*dr
)
402 int rc
= atomic_dec_return(&dr
->dr_ref
);
405 * Free the dio_request when the last reference is dropped and
406 * ensure zio_interpret is called only once with the correct zio
409 zio_t
*zio
= dr
->dr_zio
;
410 int error
= dr
->dr_error
;
412 vdev_disk_dio_free(dr
);
415 zio
->io_error
= error
;
416 ASSERT3S(zio
->io_error
, >=, 0);
418 vdev_disk_error(zio
);
420 zio_delay_interrupt(zio
);
427 BIO_END_IO_PROTO(vdev_disk_physio_completion
, bio
, error
)
429 dio_request_t
*dr
= bio
->bi_private
;
432 if (dr
->dr_error
== 0) {
433 #ifdef HAVE_1ARG_BIO_END_IO_T
434 dr
->dr_error
= BIO_END_IO_ERROR(bio
);
437 dr
->dr_error
= -(error
);
438 else if (!test_bit(BIO_UPTODATE
, &bio
->bi_flags
))
443 /* Drop reference acquired by __vdev_disk_physio */
444 rc
= vdev_disk_dio_put(dr
);
448 bio_map(struct bio
*bio
, void *bio_ptr
, unsigned int bio_size
)
450 unsigned int offset
, size
, i
;
453 offset
= offset_in_page(bio_ptr
);
454 for (i
= 0; i
< bio
->bi_max_vecs
; i
++) {
455 size
= PAGE_SIZE
- offset
;
463 if (is_vmalloc_addr(bio_ptr
))
464 page
= vmalloc_to_page(bio_ptr
);
466 page
= virt_to_page(bio_ptr
);
469 * Some network related block device uses tcp_sendpage, which
470 * doesn't behave well when using 0-count page, this is a
471 * safety net to catch them.
473 ASSERT3S(page_count(page
), >, 0);
475 if (bio_add_page(bio
, page
, size
, offset
) != size
)
487 bio_map_abd_off(struct bio
*bio
, abd_t
*abd
, unsigned int size
, size_t off
)
489 if (abd_is_linear(abd
))
490 return (bio_map(bio
, ((char *)abd_to_buf(abd
)) + off
, size
));
492 return (abd_scatter_bio_map_off(bio
, abd
, size
, off
));
496 vdev_submit_bio_impl(struct bio
*bio
)
498 #ifdef HAVE_1ARG_SUBMIT_BIO
505 #ifndef HAVE_BIO_SET_DEV
507 bio_set_dev(struct bio
*bio
, struct block_device
*bdev
)
511 #endif /* !HAVE_BIO_SET_DEV */
514 vdev_submit_bio(struct bio
*bio
)
516 #ifdef HAVE_CURRENT_BIO_TAIL
517 struct bio
**bio_tail
= current
->bio_tail
;
518 current
->bio_tail
= NULL
;
519 vdev_submit_bio_impl(bio
);
520 current
->bio_tail
= bio_tail
;
522 struct bio_list
*bio_list
= current
->bio_list
;
523 current
->bio_list
= NULL
;
524 vdev_submit_bio_impl(bio
);
525 current
->bio_list
= bio_list
;
530 __vdev_disk_physio(struct block_device
*bdev
, zio_t
*zio
,
531 size_t io_size
, uint64_t io_offset
, int rw
, int flags
)
536 int bio_size
, bio_count
= 16;
537 int i
= 0, error
= 0;
538 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
539 struct blk_plug plug
;
543 ASSERT3U(io_offset
+ io_size
, <=, bdev
->bd_inode
->i_size
);
546 dr
= vdev_disk_dio_alloc(bio_count
);
550 if (zio
&& !(zio
->io_flags
& (ZIO_FLAG_IO_RETRY
| ZIO_FLAG_TRYHARD
)))
551 bio_set_flags_failfast(bdev
, &flags
);
556 * When the IO size exceeds the maximum bio size for the request
557 * queue we are forced to break the IO in multiple bio's and wait
558 * for them all to complete. Ideally, all pool users will set
559 * their volume block size to match the maximum request size and
560 * the common case will be one bio per vdev IO request.
564 bio_offset
= io_offset
;
566 for (i
= 0; i
<= dr
->dr_bio_count
; i
++) {
568 /* Finished constructing bio's for given buffer */
573 * By default only 'bio_count' bio's per dio are allowed.
574 * However, if we find ourselves in a situation where more
575 * are needed we allocate a larger dio and warn the user.
577 if (dr
->dr_bio_count
== i
) {
578 vdev_disk_dio_free(dr
);
583 /* bio_alloc() with __GFP_WAIT never returns NULL */
584 dr
->dr_bio
[i
] = bio_alloc(GFP_NOIO
,
585 MIN(abd_nr_pages_off(zio
->io_abd
, bio_size
, abd_offset
),
587 if (unlikely(dr
->dr_bio
[i
] == NULL
)) {
588 vdev_disk_dio_free(dr
);
592 /* Matching put called by vdev_disk_physio_completion */
593 vdev_disk_dio_get(dr
);
595 bio_set_dev(dr
->dr_bio
[i
], bdev
);
596 BIO_BI_SECTOR(dr
->dr_bio
[i
]) = bio_offset
>> 9;
597 dr
->dr_bio
[i
]->bi_end_io
= vdev_disk_physio_completion
;
598 dr
->dr_bio
[i
]->bi_private
= dr
;
599 bio_set_op_attrs(dr
->dr_bio
[i
], rw
, flags
);
601 /* Remaining size is returned to become the new size */
602 bio_size
= bio_map_abd_off(dr
->dr_bio
[i
], zio
->io_abd
,
603 bio_size
, abd_offset
);
605 /* Advance in buffer and construct another bio if needed */
606 abd_offset
+= BIO_BI_SIZE(dr
->dr_bio
[i
]);
607 bio_offset
+= BIO_BI_SIZE(dr
->dr_bio
[i
]);
610 /* Extra reference to protect dio_request during vdev_submit_bio */
611 vdev_disk_dio_get(dr
);
613 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
614 if (dr
->dr_bio_count
> 1)
615 blk_start_plug(&plug
);
618 /* Submit all bio's associated with this dio */
619 for (i
= 0; i
< dr
->dr_bio_count
; i
++)
621 vdev_submit_bio(dr
->dr_bio
[i
]);
623 #if defined(HAVE_BLK_QUEUE_HAVE_BLK_PLUG)
624 if (dr
->dr_bio_count
> 1)
625 blk_finish_plug(&plug
);
628 (void) vdev_disk_dio_put(dr
);
633 BIO_END_IO_PROTO(vdev_disk_io_flush_completion
, bio
, error
)
635 zio_t
*zio
= bio
->bi_private
;
636 #ifdef HAVE_1ARG_BIO_END_IO_T
637 zio
->io_error
= BIO_END_IO_ERROR(bio
);
639 zio
->io_error
= -error
;
642 if (zio
->io_error
&& (zio
->io_error
== EOPNOTSUPP
))
643 zio
->io_vd
->vdev_nowritecache
= B_TRUE
;
646 ASSERT3S(zio
->io_error
, >=, 0);
648 vdev_disk_error(zio
);
653 vdev_disk_io_flush(struct block_device
*bdev
, zio_t
*zio
)
655 struct request_queue
*q
;
658 q
= bdev_get_queue(bdev
);
662 bio
= bio_alloc(GFP_NOIO
, 0);
663 /* bio_alloc() with __GFP_WAIT never returns NULL */
664 if (unlikely(bio
== NULL
))
667 bio
->bi_end_io
= vdev_disk_io_flush_completion
;
668 bio
->bi_private
= zio
;
669 bio_set_dev(bio
, bdev
);
671 vdev_submit_bio(bio
);
672 invalidate_bdev(bdev
);
678 vdev_disk_io_start(zio_t
*zio
)
680 vdev_t
*v
= zio
->io_vd
;
681 vdev_disk_t
*vd
= v
->vdev_tsd
;
682 int rw
, flags
, error
;
684 switch (zio
->io_type
) {
687 if (!vdev_readable(v
)) {
688 zio
->io_error
= SET_ERROR(ENXIO
);
693 switch (zio
->io_cmd
) {
694 case DKIOCFLUSHWRITECACHE
:
696 if (zfs_nocacheflush
)
699 if (v
->vdev_nowritecache
) {
700 zio
->io_error
= SET_ERROR(ENOTSUP
);
704 error
= vdev_disk_io_flush(vd
->vd_bdev
, zio
);
708 zio
->io_error
= error
;
713 zio
->io_error
= SET_ERROR(ENOTSUP
);
720 #if defined(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG)
721 flags
= (1 << BIO_RW_UNPLUG
);
722 #elif defined(REQ_UNPLUG)
731 #if defined(HAVE_BLK_QUEUE_HAVE_BIO_RW_UNPLUG)
732 flags
= (1 << BIO_RW_UNPLUG
);
733 #elif defined(REQ_UNPLUG)
741 zio
->io_error
= SET_ERROR(ENOTSUP
);
746 zio
->io_target_timestamp
= zio_handle_io_delay(zio
);
747 error
= __vdev_disk_physio(vd
->vd_bdev
, zio
,
748 zio
->io_size
, zio
->io_offset
, rw
, flags
);
750 zio
->io_error
= error
;
757 vdev_disk_io_done(zio_t
*zio
)
760 * If the device returned EIO, we revalidate the media. If it is
761 * determined the media has changed this triggers the asynchronous
762 * removal of the device from the configuration.
764 if (zio
->io_error
== EIO
) {
765 vdev_t
*v
= zio
->io_vd
;
766 vdev_disk_t
*vd
= v
->vdev_tsd
;
768 if (check_disk_change(vd
->vd_bdev
)) {
769 vdev_bdev_invalidate(vd
->vd_bdev
);
770 v
->vdev_remove_wanted
= B_TRUE
;
771 spa_async_request(zio
->io_spa
, SPA_ASYNC_REMOVE
);
777 vdev_disk_hold(vdev_t
*vd
)
779 ASSERT(spa_config_held(vd
->vdev_spa
, SCL_STATE
, RW_WRITER
));
781 /* We must have a pathname, and it must be absolute. */
782 if (vd
->vdev_path
== NULL
|| vd
->vdev_path
[0] != '/')
786 * Only prefetch path and devid info if the device has
789 if (vd
->vdev_tsd
!= NULL
)
792 /* XXX: Implement me as a vnode lookup for the device */
793 vd
->vdev_name_vp
= NULL
;
794 vd
->vdev_devid_vp
= NULL
;
798 vdev_disk_rele(vdev_t
*vd
)
800 ASSERT(spa_config_held(vd
->vdev_spa
, SCL_STATE
, RW_WRITER
));
802 /* XXX: Implement me as a vnode rele for the device */
806 param_set_vdev_scheduler(const char *val
, zfs_kernel_param_t
*kp
)
812 return (SET_ERROR(-EINVAL
));
814 if ((p
= strchr(val
, '\n')) != NULL
)
817 if (spa_mode_global
!= 0) {
818 mutex_enter(&spa_namespace_lock
);
819 while ((spa
= spa_next(spa
)) != NULL
) {
820 if (spa_state(spa
) != POOL_STATE_ACTIVE
||
821 !spa_writeable(spa
) || spa_suspended(spa
))
824 spa_open_ref(spa
, FTAG
);
825 mutex_exit(&spa_namespace_lock
);
826 vdev_elevator_switch(spa
->spa_root_vdev
, (char *)val
);
827 mutex_enter(&spa_namespace_lock
);
828 spa_close(spa
, FTAG
);
830 mutex_exit(&spa_namespace_lock
);
833 return (param_set_charp(val
, kp
));
836 vdev_ops_t vdev_disk_ops
= {
846 VDEV_TYPE_DISK
, /* name of this vdev type */
847 B_TRUE
/* leaf vdev */
850 module_param_call(zfs_vdev_scheduler
, param_set_vdev_scheduler
,
851 param_get_charp
, &zfs_vdev_scheduler
, 0644);
852 MODULE_PARM_DESC(zfs_vdev_scheduler
, "I/O scheduler");