summaryrefslogtreecommitdiff
path: root/misc/mke2fs.c
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@clusterfs.com>2006-07-15 22:08:20 -0400
committerTheodore Ts'o <tytso@mit.edu>2006-07-15 22:08:20 -0400
commit067911ae734bb5fef7c5780a639533847b5b578c (patch)
treec179f069b6a4fee0fbf33b50632fee62701f937a /misc/mke2fs.c
parente71be1c802a596be70bf47e5844b55914ebc2ea8 (diff)
downloade2fsprogs-067911ae734bb5fef7c5780a639533847b5b578c.tar.gz
Allow default inode_size to be specified in mke2fs.conf and document mke2fs -I
This patch allows "inode_size" to be specified in the mke2fs.conf file, and always compiles in the "-I" option. In addition, it disallows specifying the inode size on rev 0 filesystems, though I don't think this was much of a danger anyways. Clean up dead lines in ext2fs.h. Signed-off-by: Andreas Dilger <adilger@clusterfs.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'misc/mke2fs.c')
-rw-r--r--misc/mke2fs.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 0004c012..2686d729 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -94,11 +94,12 @@ int linux_version_code = 0;
static void usage(void)
{
fprintf(stderr, _("Usage: %s [-c|-t|-l filename] [-b block-size] "
- "[-f fragment-size]\n\t[-i bytes-per-inode] [-j] [-J journal-options]"
- " [-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] [-O feature[,...]]\n\t"
- "[-r fs-revision] [-R options] [-qvSV] device [blocks-count]\n"),
+ "[-f fragment-size]\n\t[-i bytes-per-inode] [-I inode-size] "
+ "[-j] [-J journal-options]\n"
+ "\t[-N number-of-inodes] [-m reserved-blocks-percentage] "
+ "[-o creator-os]\n\t[-g blocks-per-group] [-L volume-label] "
+ "[-M last-mounted-directory]\n\t[-O feature[,...]] "
+ "[-r fs-revision] [-R options] [-qvSV]\n\tdevice [blocks-count]\n"),
program_name);
exit(1);
}
@@ -1076,7 +1077,6 @@ static void PRS(int argc, char *argv[])
case 's': /* deprecated */
s_opt = atoi(optarg);
break;
-#ifdef EXT2_DYNAMIC_REV
case 'I':
inode_size = strtoul(optarg, &tmp, 0);
if (*tmp) {
@@ -1085,7 +1085,6 @@ static void PRS(int argc, char *argv[])
exit(1);
}
break;
-#endif
case 'v':
verbose = 1;
break;
@@ -1413,7 +1412,15 @@ static void PRS(int argc, char *argv[])
"blocksizes greater than 4096\n\tusing ext3. "
"Use -b 4096 if this is an issue for you.\n\n"));
- if (inode_size) {
+ if (inode_size == 0) {
+ profile_get_integer(profile, "defaults", "inode_size", NULL,
+ 0, &inode_size);
+ profile_get_integer(profile, "fs_types", fs_type,
+ "inode_size", inode_size,
+ &inode_size);
+ }
+
+ if (inode_size && fs_param.s_rev_level >= EXT2_DYNAMIC_REV) {
if (inode_size < EXT2_GOOD_OLD_INODE_SIZE ||
inode_size > EXT2_BLOCK_SIZE(&fs_param) ||
inode_size & (inode_size - 1)) {
@@ -1425,7 +1432,7 @@ static void PRS(int argc, char *argv[])
}
if (inode_size != EXT2_GOOD_OLD_INODE_SIZE)
fprintf(stderr, _("Warning: %d-byte inodes not usable "
- "on most systems\n"),
+ "on older systems\n"),
inode_size);
fs_param.s_inode_size = inode_size;
}