1999-01-05 Theodore Ts'o <tytso@rsts-11.mit.edu>
+ * mke2fs.c (PRS): Allow the user to specify exactly how many
+ inodes he/she wishes.
+
* chattr.c, lsattr.c: Only print the version information for the
program if the -V option is given.
.I bytes-per-inode
]
[
+.B \-N
+.I number-of-inodes
+]
+[
.B \-m
.I reserved-blocks-percentage
]
.I bytes-per-inode
must be at least 1024.
.TP
+.I -N number-of-inodes
+overrides the default calculation of the number of inodes that should be
+reserved for the filesystem (which is based on the number of blocks and
+the bytes-per-inode ratio). This allows the user to specify the number
+of desired inodes directly.
+.TP
.I -l filename
Read the bad blocks list from
.I filename.
{
fprintf(stderr, "Usage: %s [-c|-t|-l filename] [-b block-size] "
"[-f fragment-size]\n\t[-i bytes-per-inode] "
- "[-m reserved-blocks-percentage] [-qvSV]\n\t"
- "[-o creator-os] [-g blocks-per-group] [-L volume-label]\n\t"
- "[-M last-mounted-directory] [-r fs-revision] [-R raid_opts]\n\t"
- "[-s sparse-super-flag] device [blocks-count]\n",
+ " [-N number-of-inodes]\n\t[-m reserved-blocks-percentage] "
+ "[-o creator-os] [-g blocks-per-group]\n\t[-L volume-label] "
+ "[-M last-mounted-directory] [-r fs-revision]\n\t[-R raid_opts]"
+ "[-s sparse-super-flag] [-qvSV] device [blocks-count]\n",
program_name);
exit(1);
}
blk_t max = 8192;
int inode_ratio = 4096;
int reserved_ratio = 5;
+ ino_t num_inodes = 0;
errcode_t retval;
int sparse_option = -1;
char *oldpath = getenv("PATH");
if (argc && *argv)
program_name = *argv;
while ((c = getopt (argc, argv,
- "b:cf:g:i:l:m:o:qr:R:s:tvI:SFL:M:V")) != EOF)
+ "b:cf:g:i:l:m:o:qr:R:s:tvI:SFL:M:N:V")) != EOF)
switch (c) {
case 'b':
size = strtoul(optarg, &tmp, 0);
param.s_inode_size = atoi(optarg);
break;
#endif
+ case 'N':
+ num_inodes = atoi(optarg);
+ break;
case 'v':
verbose = 1;
break;
/*
* Calculate number of inodes based on the inode ratio
*/
- param.s_inodes_count =
+ param.s_inodes_count = num_inodes ? num_inodes :
((long long) param.s_blocks_count * EXT2_BLOCK_SIZE(¶m))
/ inode_ratio;