+2012-05-01 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Handle RAIDZ on non-512B sectors.
+
+ * grub-core/fs/zfs/zfs.c (grub_zfs_device_desc): New member
+ max_children_ashift.
+ (fill_vdev_info_real): Fill max_children_ashift.
+ (read_device): Use max_children_ashift.
+
2012-05-01 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/fs/fshelp.c (grub_fshelp_find_file): Fix memory leak.
grub_uint64_t id;
grub_uint64_t guid;
unsigned ashift;
+ unsigned max_children_ashift;
/* Valid only for non-leafs. */
unsigned n_children;
}
}
+ fill->max_children_ashift = 0;
+
if (grub_strcmp (type, VDEV_TYPE_DISK) == 0
|| grub_strcmp (type, VDEV_TYPE_FILE) == 0)
{
grub_free (type);
return err;
}
+ if (fill->children[i].ashift > fill->max_children_ashift)
+ fill->max_children_ashift = fill->children[i].ashift;
}
grub_free (type);
return GRUB_ERR_NONE;
bsize = s / (desc->n_children - desc->nparity);
if (desc->nparity == 1
- && ((offset >> (desc->ashift + 11)) & 1) == c)
+ && ((offset >> (desc->ashift + 20 - desc->max_children_ashift))
+ & 1) == c)
c++;
high = grub_divmod64 ((offset >> desc->ashift) + c,
high = grub_divmod64 ((offset >> desc->ashift)
+ cur_redundancy_pow
+ ((desc->nparity == 1)
- && ((offset >> (desc->ashift + 11))
+ && ((offset >> (desc->ashift + 20
+ - desc->max_children_ashift))
& 1)),
desc->n_children, &devn);
err = read_device ((high << desc->ashift)