3474: Fix 2G limit on ZFS

This commit is contained in:
Robert Millan 2011-11-08 19:06:24 +00:00
parent cb0ff29272
commit 0cc5c3b918

View File

@ -2,6 +2,7 @@
Revisions:
3340: ZFS zlib support
3474: Fix 2G limit on ZFS
--- a/grub-core/fs/zfs/zfs.c
+++ b/grub-core/fs/zfs/zfs.c
@ -45,6 +46,24 @@ Revisions:
};
static grub_err_t zio_read_data (blkptr_t * bp, grub_zfs_endian_t endian,
@@ -224,7 +242,7 @@
*/
static grub_err_t
zio_checksum_verify (zio_cksum_t zc, grub_uint32_t checksum,
- grub_zfs_endian_t endian, char *buf, int size)
+ grub_zfs_endian_t endian, char *buf, grub_size_t size)
{
zio_eck_t *zec = (zio_eck_t *) (buf + size) - 1;
zio_checksum_info_t *ci = &zio_checksum_table[checksum];
@@ -319,7 +337,7 @@
*
*/
static grub_err_t
-uberblock_verify (uberblock_phys_t * ub, int offset)
+uberblock_verify (uberblock_phys_t * ub, grub_uint64_t offset)
{
uberblock_t *uber = &ub->ubp_uberblock;
grub_err_t err;
@@ -527,7 +545,7 @@
*buf = NULL;
@ -54,6 +73,34 @@ Revisions:
lsize = (BP_IS_HOLE(bp) ? 0 :
(((grub_zfs_to_cpu64 ((bp)->blk_prop, endian) & 0xffff) + 1)
<< SPA_MINBLOCKSHIFT));
@@ -602,7 +620,8 @@
dmu_read (dnode_end_t * dn, grub_uint64_t blkid, void **buf,
grub_zfs_endian_t *endian_out, struct grub_zfs_data *data)
{
- int idx, level;
+ int level;
+ grub_off_t idx;
blkptr_t *bp_array = dn->dn.dn_blkptr;
int epbs = dn->dn.dn_indblkshift - SPA_BLKPTRSHIFT;
blkptr_t *bp;
@@ -2248,7 +2267,7 @@
grub_zfs_read (grub_file_t file, char *buf, grub_size_t len)
{
struct grub_zfs_data *data = (struct grub_zfs_data *) file->data;
- int blksz, movesize;
+ grub_size_t blksz, movesize;
grub_size_t length;
grub_size_t read;
grub_err_t err;
@@ -2302,7 +2321,7 @@
data->file_start = blkid * blksz;
data->file_end = data->file_start + blksz;
- movesize = MIN (length, data->file_end - (int) file->offset - read);
+ movesize = MIN (length, data->file_end - file->offset - read);
grub_memmove (buf, data->file_buf + file->offset + read
- data->file_start, movesize);
--- a/include/grub/zfs/zio.h
+++ b/include/grub/zfs/zio.h
@@ -77,7 +77,15 @@