]> granicus.if.org Git - zfs/commitdiff
Update vdev_ops_t from illumos
authorIgor K <igor@dilos.org>
Fri, 21 Jun 2019 01:29:02 +0000 (04:29 +0300)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 21 Jun 2019 01:29:02 +0000 (18:29 -0700)
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

module/zfs/vdev_disk.c
module/zfs/vdev_file.c
module/zfs/vdev_indirect.c
module/zfs/vdev_mirror.c
module/zfs/vdev_missing.c
module/zfs/vdev_raidz.c
module/zfs/vdev_root.c

index 1419ae6ad54aaab3918d23f8774c364e56e1f8d5..1686ddfce77df1646299fb0d2e22bba3e80bf1ad 100644 (file)
@@ -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,
index c155057852a302eb35a957eaeba11a1bdd8ead1c..b79017f3a610205c26f9c187f230b5337daf254b 100644 (file)
@@ -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
index 4d18e33c0ab751fb2a7279d8a7129e229ca30b76..4539fa638ada8a3b84a3fddded97e843b2777b38 100644 (file)
@@ -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)
index 59cc2dcdd2ca7687bb3371aca3dc67d81dbc82c5..23ff75bfc96faa13ce18640b542533c726c17824 100644 (file)
@@ -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)
index d85993bff05246c241e46558fa33f0c4e0760071..205b23eba7f51360964c1526d8101da3b06d5b26 100644 (file)
@@ -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 */
 };
index 215cd1c12064a92f218a04bcdd8626f5287efa21..327b186713fab5e3e7364a8115581d0ae8eb9504 100644 (file)
@@ -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 */
 };
index e40b7ce8e4e8f3913e8e0567599c5d500bd8c311..7170f701360879b19b75f80da9e0c3f491cccca2 100644 (file)
@@ -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 */
 };