mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-11-17 10:01:01 +03:00
Update vdev_ops_t from illumos
Align vdev_ops_t from illumos for better compatibility. Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Igor Kozhukhov <igor@dilos.org> Closes #8925
This commit is contained in:
parent
da68988708
commit
a64f8276c7
@ -935,19 +935,19 @@ param_set_vdev_scheduler(const char *val, zfs_kernel_param_t *kp)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_disk_ops = {
|
||||
vdev_disk_open,
|
||||
vdev_disk_close,
|
||||
vdev_default_asize,
|
||||
vdev_disk_io_start,
|
||||
vdev_disk_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_disk_hold,
|
||||
vdev_disk_rele,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_DISK, /* name of this vdev type */
|
||||
B_TRUE /* leaf vdev */
|
||||
.vdev_op_open = vdev_disk_open,
|
||||
.vdev_op_close = vdev_disk_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_disk_io_start,
|
||||
.vdev_op_io_done = vdev_disk_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = vdev_disk_hold,
|
||||
.vdev_op_rele = vdev_disk_rele,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_DISK, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_TRUE /* leaf vdev */
|
||||
};
|
||||
|
||||
module_param_call(zfs_vdev_scheduler, param_set_vdev_scheduler,
|
||||
|
@ -277,19 +277,19 @@ vdev_file_io_done(zio_t *zio)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_file_ops = {
|
||||
vdev_file_open,
|
||||
vdev_file_close,
|
||||
vdev_default_asize,
|
||||
vdev_file_io_start,
|
||||
vdev_file_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_file_hold,
|
||||
vdev_file_rele,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_FILE, /* name of this vdev type */
|
||||
B_TRUE /* leaf vdev */
|
||||
.vdev_op_open = vdev_file_open,
|
||||
.vdev_op_close = vdev_file_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_file_io_start,
|
||||
.vdev_op_io_done = vdev_file_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = vdev_file_hold,
|
||||
.vdev_op_rele = vdev_file_rele,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_FILE, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_TRUE /* leaf vdev */
|
||||
};
|
||||
|
||||
void
|
||||
@ -313,19 +313,19 @@ vdev_file_fini(void)
|
||||
#ifndef _KERNEL
|
||||
|
||||
vdev_ops_t vdev_disk_ops = {
|
||||
vdev_file_open,
|
||||
vdev_file_close,
|
||||
vdev_default_asize,
|
||||
vdev_file_io_start,
|
||||
vdev_file_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_file_hold,
|
||||
vdev_file_rele,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_DISK, /* name of this vdev type */
|
||||
B_TRUE /* leaf vdev */
|
||||
.vdev_op_open = vdev_file_open,
|
||||
.vdev_op_close = vdev_file_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_file_io_start,
|
||||
.vdev_op_io_done = vdev_file_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = vdev_file_hold,
|
||||
.vdev_op_rele = vdev_file_rele,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_DISK, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_TRUE /* leaf vdev */
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -1842,19 +1842,19 @@ vdev_indirect_io_done(zio_t *zio)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_indirect_ops = {
|
||||
vdev_indirect_open,
|
||||
vdev_indirect_close,
|
||||
vdev_default_asize,
|
||||
vdev_indirect_io_start,
|
||||
vdev_indirect_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_indirect_remap,
|
||||
NULL,
|
||||
VDEV_TYPE_INDIRECT, /* name of this vdev type */
|
||||
B_FALSE /* leaf vdev */
|
||||
.vdev_op_open = vdev_indirect_open,
|
||||
.vdev_op_close = vdev_indirect_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_indirect_io_start,
|
||||
.vdev_op_io_done = vdev_indirect_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = vdev_indirect_remap,
|
||||
.vdev_op_xlate = NULL,
|
||||
.vdev_op_type = VDEV_TYPE_INDIRECT, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* leaf vdev */
|
||||
};
|
||||
|
||||
#if defined(_KERNEL)
|
||||
|
@ -786,51 +786,51 @@ vdev_mirror_state_change(vdev_t *vd, int faulted, int degraded)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_mirror_ops = {
|
||||
vdev_mirror_open,
|
||||
vdev_mirror_close,
|
||||
vdev_default_asize,
|
||||
vdev_mirror_io_start,
|
||||
vdev_mirror_io_done,
|
||||
vdev_mirror_state_change,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_MIRROR, /* name of this vdev type */
|
||||
B_FALSE /* not a leaf vdev */
|
||||
.vdev_op_open = vdev_mirror_open,
|
||||
.vdev_op_close = vdev_mirror_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_mirror_io_start,
|
||||
.vdev_op_io_done = vdev_mirror_io_done,
|
||||
.vdev_op_state_change = vdev_mirror_state_change,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_MIRROR, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* not a leaf vdev */
|
||||
};
|
||||
|
||||
vdev_ops_t vdev_replacing_ops = {
|
||||
vdev_mirror_open,
|
||||
vdev_mirror_close,
|
||||
vdev_default_asize,
|
||||
vdev_mirror_io_start,
|
||||
vdev_mirror_io_done,
|
||||
vdev_mirror_state_change,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_REPLACING, /* name of this vdev type */
|
||||
B_FALSE /* not a leaf vdev */
|
||||
.vdev_op_open = vdev_mirror_open,
|
||||
.vdev_op_close = vdev_mirror_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_mirror_io_start,
|
||||
.vdev_op_io_done = vdev_mirror_io_done,
|
||||
.vdev_op_state_change = vdev_mirror_state_change,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_REPLACING, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* not a leaf vdev */
|
||||
};
|
||||
|
||||
vdev_ops_t vdev_spare_ops = {
|
||||
vdev_mirror_open,
|
||||
vdev_mirror_close,
|
||||
vdev_default_asize,
|
||||
vdev_mirror_io_start,
|
||||
vdev_mirror_io_done,
|
||||
vdev_mirror_state_change,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_default_xlate,
|
||||
VDEV_TYPE_SPARE, /* name of this vdev type */
|
||||
B_FALSE /* not a leaf vdev */
|
||||
.vdev_op_open = vdev_mirror_open,
|
||||
.vdev_op_close = vdev_mirror_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_mirror_io_start,
|
||||
.vdev_op_io_done = vdev_mirror_io_done,
|
||||
.vdev_op_state_change = vdev_mirror_state_change,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_default_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_SPARE, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* not a leaf vdev */
|
||||
};
|
||||
|
||||
#if defined(_KERNEL)
|
||||
|
@ -80,33 +80,33 @@ vdev_missing_io_done(zio_t *zio)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_missing_ops = {
|
||||
vdev_missing_open,
|
||||
vdev_missing_close,
|
||||
vdev_default_asize,
|
||||
vdev_missing_io_start,
|
||||
vdev_missing_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
VDEV_TYPE_MISSING, /* name of this vdev type */
|
||||
B_TRUE /* leaf vdev */
|
||||
.vdev_op_open = vdev_missing_open,
|
||||
.vdev_op_close = vdev_missing_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_missing_io_start,
|
||||
.vdev_op_io_done = vdev_missing_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = NULL,
|
||||
.vdev_op_type = VDEV_TYPE_MISSING, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_TRUE /* leaf vdev */
|
||||
};
|
||||
|
||||
vdev_ops_t vdev_hole_ops = {
|
||||
vdev_missing_open,
|
||||
vdev_missing_close,
|
||||
vdev_default_asize,
|
||||
vdev_missing_io_start,
|
||||
vdev_missing_io_done,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
VDEV_TYPE_HOLE, /* name of this vdev type */
|
||||
B_TRUE /* leaf vdev */
|
||||
.vdev_op_open = vdev_missing_open,
|
||||
.vdev_op_close = vdev_missing_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = vdev_missing_io_start,
|
||||
.vdev_op_io_done = vdev_missing_io_done,
|
||||
.vdev_op_state_change = NULL,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = NULL,
|
||||
.vdev_op_type = VDEV_TYPE_HOLE, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_TRUE /* leaf vdev */
|
||||
};
|
||||
|
@ -2403,17 +2403,17 @@ vdev_raidz_xlate(vdev_t *cvd, const range_seg_t *in, range_seg_t *res)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_raidz_ops = {
|
||||
vdev_raidz_open,
|
||||
vdev_raidz_close,
|
||||
vdev_raidz_asize,
|
||||
vdev_raidz_io_start,
|
||||
vdev_raidz_io_done,
|
||||
vdev_raidz_state_change,
|
||||
vdev_raidz_need_resilver,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
vdev_raidz_xlate,
|
||||
VDEV_TYPE_RAIDZ, /* name of this vdev type */
|
||||
B_FALSE /* not a leaf vdev */
|
||||
.vdev_op_open = vdev_raidz_open,
|
||||
.vdev_op_close = vdev_raidz_close,
|
||||
.vdev_op_asize = vdev_raidz_asize,
|
||||
.vdev_op_io_start = vdev_raidz_io_start,
|
||||
.vdev_op_io_done = vdev_raidz_io_done,
|
||||
.vdev_op_state_change = vdev_raidz_state_change,
|
||||
.vdev_op_need_resilver = vdev_raidz_need_resilver,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = vdev_raidz_xlate,
|
||||
.vdev_op_type = VDEV_TYPE_RAIDZ, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* not a leaf vdev */
|
||||
};
|
||||
|
@ -140,17 +140,17 @@ vdev_root_state_change(vdev_t *vd, int faulted, int degraded)
|
||||
}
|
||||
|
||||
vdev_ops_t vdev_root_ops = {
|
||||
vdev_root_open,
|
||||
vdev_root_close,
|
||||
vdev_default_asize,
|
||||
NULL, /* io_start - not applicable to the root */
|
||||
NULL, /* io_done - not applicable to the root */
|
||||
vdev_root_state_change,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
VDEV_TYPE_ROOT, /* name of this vdev type */
|
||||
B_FALSE /* not a leaf vdev */
|
||||
.vdev_op_open = vdev_root_open,
|
||||
.vdev_op_close = vdev_root_close,
|
||||
.vdev_op_asize = vdev_default_asize,
|
||||
.vdev_op_io_start = NULL, /* not applicable to the root */
|
||||
.vdev_op_io_done = NULL, /* not applicable to the root */
|
||||
.vdev_op_state_change = vdev_root_state_change,
|
||||
.vdev_op_need_resilver = NULL,
|
||||
.vdev_op_hold = NULL,
|
||||
.vdev_op_rele = NULL,
|
||||
.vdev_op_remap = NULL,
|
||||
.vdev_op_xlate = NULL,
|
||||
.vdev_op_type = VDEV_TYPE_ROOT, /* name of this vdev type */
|
||||
.vdev_op_leaf = B_FALSE /* not a leaf vdev */
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user