* include/grub/zfs/spa.h (zio_cksum): Add explicit members for mac.

* grub-core/fs/zfs/zfs.c (zio_read): Don't use casts to retrieve mac.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2013-08-22 16:20:32 +02:00
parent ed7fbf43c2
commit bdb5ba47d8
3 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-08-22 Vladimir Serbinenko <phcoder@gmail.com>
* include/grub/zfs/spa.h (zio_cksum): Add explicit members for mac.
* grub-core/fs/zfs/zfs.c (zio_read): Don't use casts to retrieve mac.
2013-08-22 Vladimir Serbinenko <phcoder@gmail.com> 2013-08-22 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no * grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no

View file

@ -1871,7 +1871,7 @@ zio_read (blkptr_t *bp, grub_zfs_endian_t endian, void **buf,
err = grub_zfs_decrypt (data->subvol.keyring[besti].cipher, err = grub_zfs_decrypt (data->subvol.keyring[besti].cipher,
data->subvol.keyring[besti].algo, data->subvol.keyring[besti].algo,
&(bp)->blk_dva[encrypted], &(bp)->blk_dva[encrypted],
compbuf, psize, ((grub_uint32_t *) &zc + 5), compbuf, psize, zc.zc_mac,
endian); endian);
} }
if (err) if (err)

View file

@ -97,7 +97,15 @@ typedef struct dva {
* Each block has a 256-bit checksum -- strong enough for cryptographic hashes. * Each block has a 256-bit checksum -- strong enough for cryptographic hashes.
*/ */
typedef struct zio_cksum { typedef struct zio_cksum {
union
{
grub_uint64_t zc_word[4]; grub_uint64_t zc_word[4];
struct
{
grub_uint32_t zc_cut_cksum[5];
grub_uint32_t zc_mac[3];
};
};
} zio_cksum_t; } zio_cksum_t;
/* /*