ChangeLog, mke2fs.8.in, mke2fs.c:
mke2fs.c: Add new filesystem types, largefile and largefile4, for
those filesystems whose average inode size is 1MB and 4MB,
respectively. Allow the inode ratio specified to be has high as 4MB.
Make the s_max_mount_count vary between 20 and 40, to avoid needing to
check all of the filesystems at the same time. Add some random jitter
to the s_max_mount_count value so that we avoid checking all of the
filesystems at the same time when we reboot.
diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index b611065..b72ea1b 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -137,6 +137,8 @@
{ default_str, 512, 1024, 4096 },
{ default_str, 3, 1024, 8192 },
{ "news", 0, 4096, 4096 },
+ { "largefile", 0, 4096, 1024 * 1024 },
+ { "largefile4", 0, 4096, 4096 * 1024 },
{ 0, 0, 0, 0},
};
@@ -725,7 +727,7 @@
break;
case 'i':
inode_ratio = strtoul(optarg, &tmp, 0);
- if (inode_ratio < 1024 || inode_ratio > 256 * 1024 ||
+ if (inode_ratio < 1024 || inode_ratio > 4096 * 1024 ||
*tmp) {
com_err(program_name, 0,
_("bad inode ratio - %s"), optarg);
@@ -927,6 +929,7 @@
ext2_filsys fs;
badblocks_list bb_list = 0;
int journal_blocks;
+ int i, val;
#ifdef ENABLE_NLS
setlocale(LC_MESSAGES, "");
@@ -956,6 +959,15 @@
uuid_generate(fs->super->s_uuid);
/*
+ * Add "jitter" to the superblock's check interval so that we
+ * don't check all the filesystems at the same time. We use a
+ * kludgy hack of using the UUID to derive a random jitter value.
+ */
+ for (i = 0, val = 0 ; i < sizeof(fs->super->s_uuid); i++)
+ val += fs->super->s_uuid[i];
+ fs->super->s_max_mnt_count += val % EXT2_DFL_MAX_MNT_COUNT;
+
+ /*
* Override the creator OS, if applicable
*/
if (creator_os && !set_os(fs->super, creator_os)) {