+2012-05-09 Vladimir Serbinenko <phcoder@gmail.com>
+
+ Fix wrapped HFS+ handling.
+
+ * grub-core/fs/fshelp.c (grub_fshelp_read_file): New argument
+ blocks_start. All users updated.
+ * grub-core/fs/hfsplus.c (grub_hfsplus_read_block): Don't add
+ wrapping offset.
+ (grub_hfsplus_read_file): Pass embedding offset to fshelp_read_file.
+
2012-05-09 Vladimir Serbinenko <phcoder@gmail.com>
Fix long symlinks on reiserfs.
file->read_hook,
file->offset, len, buf, grub_affs_read_block,
grub_be_to_cpu32 (data->diropen.di.size),
- data->log_blocksize);
+ data->log_blocksize, 0);
}
static grub_int32_t
pos, len, buf, grub_ext2_read_block,
grub_cpu_to_le32 (node->inode.size)
| (((grub_off_t) grub_cpu_to_le32 (node->inode.size_high)) << 32),
- LOG2_EXT2_BLOCK_SIZE (node->data));
+ LOG2_EXT2_BLOCK_SIZE (node->data), 0);
}
grub_off_t pos, grub_size_t len, char *buf,
grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
grub_disk_addr_t block),
- grub_off_t filesize, int log2blocksize)
+ grub_off_t filesize, int log2blocksize,
+ grub_disk_addr_t blocks_start)
{
grub_disk_addr_t i, blockcnt;
int blocksize = 1 << (log2blocksize + GRUB_DISK_SECTOR_BITS);
{
disk->read_hook = read_hook;
- grub_disk_read (disk, blknr, skipfirst,
+ grub_disk_read (disk, blknr + blocks_start, skipfirst,
blockend, buf);
disk->read_hook = 0;
if (grub_errno)
nnode = 0;
if (blk != 0xffffffffffffffffULL)
- return (blk
- + (node->data->embedded_offset >> (node->data->log2blksize
- - GRUB_DISK_SECTOR_BITS)));
+ return blk;
/* For the extent overflow file, extra extents can't be found in
the extent overflow file. If this happens, you found a
return grub_fshelp_read_file (node->data->disk, node, read_hook,
pos, len, buf, grub_hfsplus_read_block,
node->size,
- node->data->log2blksize - GRUB_DISK_SECTOR_BITS);
+ node->data->log2blksize - GRUB_DISK_SECTOR_BITS,
+ node->data->embedded_offset);
}
static struct grub_hfsplus_data *
return grub_fshelp_read_file (node->data->disk, node, read_hook,
pos, len, buf, grub_nilfs2_read_block,
grub_le_to_cpu64 (node->inode.i_size),
- LOG2_NILFS2_BLOCK_SIZE (node->data));
+ LOG2_NILFS2_BLOCK_SIZE (node->data), 0);
}
if (!grub_fshelp_log2blksize (ctx->comp.spc, &pow))
grub_fshelp_read_file (ctx->comp.disk, (grub_fshelp_node_t) ctx,
read_hook, ofs, len, dest,
- grub_ntfs_read_block, ofs + len, pow);
+ grub_ntfs_read_block, ofs + len, pow, 0);
return grub_errno;
}
{
return grub_fshelp_read_file (node->data->disk, node, read_hook,
pos, len, buf, grub_sfs_read_block,
- node->size, node->data->log_blocksize);
+ node->size, node->data->log_blocksize, 0);
}
return grub_fshelp_read_file (node->data->disk, node, read_hook,
pos, len, buf, grub_udf_read_block,
U64 (node->block.fe.file_size),
- node->data->lbshift);
+ node->data->lbshift, 0);
}
static unsigned sblocklist[] = { 256, 512, 0 };
pos, len, buf, grub_xfs_read_block,
grub_be_to_cpu64 (node->inode.size),
node->data->sblock.log2_bsize
- - GRUB_DISK_SECTOR_BITS);
+ - GRUB_DISK_SECTOR_BITS, 0);
}
grub_off_t pos, grub_size_t len, char *buf,
grub_disk_addr_t (*get_block) (grub_fshelp_node_t node,
grub_disk_addr_t block),
- grub_off_t filesize, int log2blocksize);
+ grub_off_t filesize, int log2blocksize,
+ grub_disk_addr_t blocks_start);
unsigned int
EXPORT_FUNC(grub_fshelp_log2blksize) (unsigned int blksize,