zio->io_vsd = rm;
zio->io_vsd_ops = &vdev_raidz_vsd_ops;
- /* RAIDZ ops init */
- vdev_raidz_math_get_ops(rm);
+ /* init RAIDZ parity ops */
+ rm->rm_ops = vdev_raidz_math_get_ops();
return (rm);
}
void
vdev_raidz_generate_parity(raidz_map_t *rm)
{
- if (rm->rm_ops) {
- vdev_raidz_math_generate(rm);
+ /* Generate using the new math implementation */
+ if (vdev_raidz_math_generate(rm) != RAIDZ_ORIGINAL_IMPL)
return;
- }
switch (rm->rm_firstdatacol) {
case 1:
{
int tgts[VDEV_RAIDZ_MAXPARITY], *dt;
int ntgts;
- int i, c;
+ int i, c, ret;
int code;
int nbadparity, nbaddata;
int parity_valid[VDEV_RAIDZ_MAXPARITY];
dt = &tgts[nbadparity];
- /*
- * Reconstruct using the new math implementation if
- * rm_ops is set.
- */
- if (rm->rm_ops) {
- return (vdev_raidz_math_reconstruct(rm, parity_valid, dt,
- nbaddata));
- }
+
+ /* Reconstruct using the new math implementation */
+ ret = vdev_raidz_math_reconstruct(rm, parity_valid, dt, nbaddata);
+ if (ret != RAIDZ_ORIGINAL_IMPL)
+ return (ret);
/*
* See if we can use any of our optimized reconstruction routines.