Fix fzap handling

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-12-05 15:35:08 +01:00
parent c5cf9f53a8
commit fe79a8ad9d
2 changed files with 4 additions and 2 deletions

View file

@ -961,7 +961,8 @@ fzap_iterate (dnode_end_t * zap_dnode, zap_phys_t * zap,
grub_error (GRUB_ERR_BAD_FS, "ZAP leaf is too small");
return 0;
}
for (idx = 0; idx < zap->zap_ptrtbl.zt_numblks; idx++)
for (idx = 0; idx < grub_zfs_to_cpu64 (zap->zap_num_leafs,
zap_dnode->endian); idx++)
{
blkid = ((grub_uint64_t *) zap)[idx + (1 << (blksft - 3 - 1))];
@ -2553,6 +2554,7 @@ static struct grub_fs grub_zfs_fs = {
GRUB_MOD_INIT (zfs)
{
COMPILE_TIME_ASSERT (sizeof (zap_leaf_chunk_t) == ZAP_LEAF_CHUNKSIZE);
grub_fs_register (&grub_zfs_fs);
#ifndef GRUB_UTIL
my_mod = mod;

View file

@ -90,7 +90,7 @@ typedef union zap_leaf_chunk {
{
grub_uint8_t la_array[ZAP_LEAF_ARRAY_BYTES];
grub_uint64_t la_array64;
};
} __attribute__ ((packed));
grub_uint16_t la_next; /* next blk or CHAIN_END */
} l_array;
struct zap_leaf_free {