1 -----------------------------------------------------------------------------
2 >>>>>>>>>>> aboot-0.5-8 patches
3 -----------------------------------------------------------------------------
5 --- fs/ext2.c.ORIG Thu Apr 22 17:29:39 1999
6 +++ fs/ext2.c Thu Apr 22 17:49:18 1999
11 -#define MAX_SUPPORTED_GROUPS 256 /* supports 2GB filesystem */
12 #define MAX_OPEN_FILES 4
14 extern struct bootfs ext2fs;
16 static struct ext2_super_block sb;
17 -static struct ext2_group_desc gds[MAX_SUPPORTED_GROUPS];
18 +static struct ext2_group_desc *gds;
19 static int ngroups = 0;
20 static int directlim; /* Maximum direct blkno */
21 static int ind1lim; /* Maximum single-indir blkno */
24 ngroups = (sb.s_blocks_count + sb.s_blocks_per_group - 1)
25 / sb.s_blocks_per_group;
26 - if (ngroups > MAX_SUPPORTED_GROUPS) {
27 - printf("ext2_init: too many groups (%d): max is %d\n",
28 - ngroups, MAX_SUPPORTED_GROUPS);
32 + gds = (struct ext2_group_desc *)
33 + malloc((size_t)(ngroups * sizeof(struct ext2_group_desc)));
35 /* read in the group descriptors (immediately follows superblock) */
36 cons_read(dev, gds, ngroups * sizeof(struct ext2_group_desc),
38 --- tools/e2lib.c.ORIG Thu Apr 22 17:53:20 1999
39 +++ tools/e2lib.c Thu Apr 22 17:54:20 1999
44 -#define MAX_SUPPORTED_GROUPS 256 /* Supports 2Gb filesystem */
45 #define MAX_OPEN_FILES 8
48 struct ext2_super_block sb;
49 -struct ext2_group_desc gds[MAX_SUPPORTED_GROUPS];
50 +struct ext2_group_desc *gds;
52 int blocksize; /* Block size of this fs */
53 int directlim; /* Maximum direct blkno */
57 ngroups = (sb.s_blocks_count+sb.s_blocks_per_group-1)/sb.s_blocks_per_group;
58 - if(ngroups > MAX_SUPPORTED_GROUPS) {
59 - fprintf(stderr, "ext2_init: too many groups (%d): max is %d\n",
60 - ngroups, MAX_SUPPORTED_GROUPS);
63 + gds = (struct ext2_group_desc *)
64 + malloc((size_t)(ngroups * sizeof(struct ext2_group_desc)));
66 /* Read in the group descriptors (immediately follows superblock) */
67 if ((size_t) read(fd, gds, ngroups * sizeof(struct ext2_group_desc))
69 -----------------------------------------------------------------------------