From bdb5ba47d8f4672299d3cbba3f140a57fc6f577f Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Thu, 22 Aug 2013 16:20:32 +0200 Subject: [PATCH] * 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. --- ChangeLog | 5 +++++ grub-core/fs/zfs/zfs.c | 2 +- include/grub/zfs/spa.h | 8 ++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index accdd4c67..4780ec1ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-08-22 Vladimir Serbinenko + + * 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 * grub-core/kern/emu/mm.c (grub_memalign): Don't define if there is no diff --git a/grub-core/fs/zfs/zfs.c b/grub-core/fs/zfs/zfs.c index f4acfd827..7302b0af5 100644 --- a/grub-core/fs/zfs/zfs.c +++ b/grub-core/fs/zfs/zfs.c @@ -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, data->subvol.keyring[besti].algo, &(bp)->blk_dva[encrypted], - compbuf, psize, ((grub_uint32_t *) &zc + 5), + compbuf, psize, zc.zc_mac, endian); } if (err) diff --git a/include/grub/zfs/spa.h b/include/grub/zfs/spa.h index 19a2b640a..7edb8ab7d 100644 --- a/include/grub/zfs/spa.h +++ b/include/grub/zfs/spa.h @@ -97,7 +97,15 @@ typedef struct dva { * Each block has a 256-bit checksum -- strong enough for cryptographic hashes. */ typedef struct zio_cksum { + union + { grub_uint64_t zc_word[4]; + struct + { + grub_uint32_t zc_cut_cksum[5]; + grub_uint32_t zc_mac[3]; + }; + }; } zio_cksum_t; /*