From af4b2d89a07f412207cba51e445957c91e4f0378 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 3 Jan 2006 16:27:31 +0000 Subject: [PATCH] 2006-01-03 Marco Gerards * fs/hfsplus.c (grub_hfsplus_read_block): Convert the offset of the HFS+ filesystem to filesystem blocks. (grub_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a GCC warning is silenced. --- ChangeLog | 7 +++++++ fs/hfsplus.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8348f90ff..520da5797 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-01-03 Marco Gerards + + * fs/hfsplus.c (grub_hfsplus_read_block): Convert the offset of + the HFS+ filesystem to filesystem blocks. + (grub_hfsplus_iterate_dir): Cast the `fileinfo' assignment so a + GCC warning is silenced. + 2006-01-03 Marco Gerards * partmap/apple.c (apple_partition_map_iterate): Convert the data diff --git a/fs/hfsplus.c b/fs/hfsplus.c index b6682685d..b29fb1f3c 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -279,7 +279,8 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, int fileblock) /* Try to find this block in the current set of extents. */ blk = grub_hfsplus_find_block (extents, fileblock, &retry); if (blk != -1) - return blk + node->data->embedded_offset; + return blk + (node->data->embedded_offset >> (node->data->log2blksize + - GRUB_DISK_SECTOR_BITS)); /* The previous iteration of this loop allocated memory. The code above used this memory, it can be free'ed now. */ @@ -704,8 +705,11 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, catkey = (struct grub_hfsplus_catkey *) record; - fileinfo = (record + grub_be_to_cpu16 (catkey->keylen) - + 2 + grub_be_to_cpu16(catkey->keylen) % 2); + fileinfo = + (struct grub_hfsplus_catfile *) ((char *) record + + grub_be_to_cpu16 (catkey->keylen) + + 2 + (grub_be_to_cpu16(catkey->keylen) + % 2)); /* Stop iterating when the last directory entry was found. */ if (grub_be_to_cpu32 (catkey->parent) != dir->fileid)