1
Description: Support big ext2 files
2
Author: Vladimir Serbinenko <phcoder@gmail.com>
3
Origin: upstream, http://bazaar.launchpad.net/~vcs-imports/grub/grub2-bzr/revision/2936
4
Bug-Debian: http://bugs.debian.org/543924
6
Last-Update: 2010-12-21
9
===================================================================
14
grub_uint32_t version;
16
- grub_uint32_t dir_acl;
17
+ grub_uint32_t size_high;
18
grub_uint32_t fragment_addr;
19
grub_uint32_t osd2[3];
22
blknr = grub_le_to_cpu32 (indir[rblock % perblock]);
24
/* triple indirect. */
25
+ else if (fileblock < INDIRECT_BLOCKS + blksz / 4 * (blksz / 4 + 1)
26
+ + (blksz / 4) * (blksz / 4) * (blksz / 4 + 1))
28
+ unsigned int perblock = blksz / 4;
29
+ unsigned int rblock = fileblock - (INDIRECT_BLOCKS + blksz / 4
31
+ grub_uint32_t indir[blksz / 4];
33
+ if (grub_disk_read (data->disk,
35
+ grub_le_to_cpu32 (inode->blocks.triple_indir_block))
40
+ if (grub_disk_read (data->disk,
42
+ grub_le_to_cpu32 (indir[(rblock / perblock) / perblock]))
47
+ if (grub_disk_read (data->disk,
49
+ grub_le_to_cpu32 (indir[(rblock / perblock) % perblock]))
54
+ blknr = grub_le_to_cpu32 (indir[rblock % perblock]);
58
grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET,
59
- "ext2fs doesn't support triple indirect blocks");
60
+ "ext2fs doesn't support quadruple indirect blocks");
65
grub_ext2_read_file (grub_fshelp_node_t node,
66
void NESTED_FUNC_ATTR (*read_hook) (grub_disk_addr_t sector,
67
unsigned offset, unsigned length),
68
- int pos, grub_size_t len, char *buf)
69
+ grub_off_t pos, grub_size_t len, char *buf)
71
return grub_fshelp_read_file (node->data->disk, node, read_hook,
72
pos, len, buf, grub_ext2_read_block,
74
+ grub_cpu_to_le32 (node->inode.size)
75
+ | (((grub_off_t) grub_cpu_to_le32 (node->inode.size_high)) << 32),
76
LOG2_EXT2_BLOCK_SIZE (node->data));
82
file->size = grub_le_to_cpu32 (data->inode->size);
83
+ file->size |= ((grub_off_t) grub_le_to_cpu32 (data->inode->size_high)) << 32;