1 Index: genext2fs/genext2fs.c
2 ===================================================================
3 --- genext2fs.orig/genext2fs.c 2005-03-10 21:18:08.000000000 -0500
4 +++ genext2fs/genext2fs.c 2005-03-13 11:41:55.182746832 -0500
6 " -d, --root <directory>\n"
7 " -D, --devtable <file>\n"
8 " -b, --size-in-blocks <blocks>\n"
9 + " -I, --bytes-per-inode <bytes per inode>\n"
10 " -i, --number-of-inodes <number of inodes>\n"
11 " -r, --reserved-blocks <number of reserved blocks>\n"
12 " -g, --block-map <path> Generate a block map file for this path.\n"
15 int tmp_nbblocks = -1;
16 int tmp_nbinodes = -1;
17 + int bytes_per_inode = BYTES_PER_INODE;
18 uint32 fs_timestamp = -1;
22 { "root", required_argument, NULL, 'd' },
23 { "devtable", required_argument, NULL, 'D' },
24 { "size-in-blocks", required_argument, NULL, 'b' },
25 + { "bytes-per-inode", required_argument, NULL, 'I' },
26 { "number-of-inodes", required_argument, NULL, 'i' },
27 { "reserved-blocks", required_argument, NULL, 'r' },
28 { "block-map", required_argument, NULL, 'g' },
33 - while((c = getopt_long(argc, argv, "x:d:D:b:i:r:g:e:zfqUPhv", longopts, NULL)) != EOF) {
34 + while((c = getopt_long(argc, argv, "x:d:D:b:I:i:r:g:e:zfqUPhv", longopts, NULL)) != EOF) {
40 nbblocks = atoi(optarg);
43 + bytes_per_inode = atoi(optarg);
46 nbinodes = atoi(optarg);
48 @@ -2468,24 +2474,22 @@
54 tmp_nbinodes = stats.ninodes + EXT2_FIRST_INO + 1;
55 tmp_nbblocks = stats.nblocks; // FIXME: should add space taken by inodes too
58 if(tmp_nbblocks > nbblocks)
60 fprintf(stderr, "number of blocks too low, increasing to %d\n",tmp_nbblocks);
61 nbblocks = tmp_nbblocks;
64 + nbinodes = nbblocks * BLOCKSIZE / rndup(bytes_per_inode, BLOCKSIZE);
65 if(tmp_nbinodes > nbinodes)
67 fprintf(stderr, "number of inodes too low, increasing to %d\n",tmp_nbinodes);
68 nbinodes = tmp_nbinodes;
71 - error_msg_and_die("filesystem size unspecified");
73 - nbinodes = nbblocks * BLOCKSIZE / rndup(BYTES_PER_INODE, BLOCKSIZE);
75 nbresrvd = nbblocks * RESERVED_BLOCKS;
76 if(fs_timestamp == -1)