]>
Commit | Line | Data |
---|---|---|
06ba8679 JR |
1 | ----------------------------------------------------------------------------- |
2 | >>>>>>>>>>> aboot-0.5-8 patches | |
3 | ----------------------------------------------------------------------------- | |
4 | ||
5 | --- fs/ext2.c.ORIG Thu Apr 22 17:29:39 1999 | |
6 | +++ fs/ext2.c Thu Apr 22 17:49:18 1999 | |
7 | @@ -20,13 +20,12 @@ | |
8 | #include "disklabel.h" | |
9 | #include "utils.h" | |
10 | ||
11 | -#define MAX_SUPPORTED_GROUPS 256 /* supports 2GB filesystem */ | |
12 | #define MAX_OPEN_FILES 4 | |
13 | ||
14 | extern struct bootfs ext2fs; | |
15 | ||
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 */ | |
22 | @@ -87,11 +86,9 @@ | |
23 | ||
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); | |
29 | - return -1; | |
30 | - } | |
31 | + | |
32 | + gds = (struct ext2_group_desc *) | |
33 | + malloc((size_t)(ngroups * sizeof(struct ext2_group_desc))); | |
34 | ||
35 | /* read in the group descriptors (immediately follows superblock) */ | |
36 | cons_read(dev, gds, ngroups * sizeof(struct ext2_group_desc), | |
37 | ||
38 | --- tools/e2lib.c.ORIG Thu Apr 22 17:53:20 1999 | |
39 | +++ tools/e2lib.c Thu Apr 22 17:54:20 1999 | |
40 | @@ -18,12 +18,11 @@ | |
41 | #include <e2lib.h> | |
42 | ||
43 | ||
44 | -#define MAX_SUPPORTED_GROUPS 256 /* Supports 2Gb filesystem */ | |
45 | #define MAX_OPEN_FILES 8 | |
46 | ||
47 | int fd = -1; | |
48 | struct ext2_super_block sb; | |
49 | -struct ext2_group_desc gds[MAX_SUPPORTED_GROUPS]; | |
50 | +struct ext2_group_desc *gds; | |
51 | int ngroups = 0; | |
52 | int blocksize; /* Block size of this fs */ | |
53 | int directlim; /* Maximum direct blkno */ | |
54 | @@ -194,11 +193,8 @@ | |
55 | } | |
56 | ||
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); | |
61 | - return(-1); | |
62 | - } | |
63 | + gds = (struct ext2_group_desc *) | |
64 | + malloc((size_t)(ngroups * sizeof(struct ext2_group_desc))); | |
65 | ||
66 | /* Read in the group descriptors (immediately follows superblock) */ | |
67 | if ((size_t) read(fd, gds, ngroups * sizeof(struct ext2_group_desc)) | |
68 | ||
69 | ----------------------------------------------------------------------------- |