diff --git a/fs/xfs.c b/fs/xfs.c index 7da3e40..7b9d778 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -56,12 +56,8 @@ struct grub_xfs_sblock struct grub_xfs_dir_header { grub_uint8_t count; - grub_uint8_t i8count; - union - { - grub_uint32_t i4; - grub_uint64_t i8; - } parent __attribute__ ((packed)); + grub_uint8_t smallno; + grub_uint32_t parent; } __attribute__ ((packed)); struct grub_xfs_dir_entry @@ -423,7 +419,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, case XFS_INODE_FORMAT_INO: { struct grub_xfs_dir_entry *de = &diro->inode.data.dir.direntry[0]; - int smallino = !diro->inode.data.dir.dirhead.i8count; + int smallino = !diro->inode.data.dir.dirhead.smallno; int i; grub_uint64_t parent; @@ -431,12 +427,12 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, parent inode number is small too. */ if (smallino) { - parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4); + parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent); parent = grub_cpu_to_be64 (parent); } else { - parent = diro->inode.data.dir.dirhead.parent.i8; + parent = *(grub_uint64_t *) &diro->inode.data.dir.dirhead.parent; /* The header is a bit bigger than usual. */ de = (struct grub_xfs_dir_entry *) ((char *) de + 4); }