Whamcloud - gitweb
ChangeLog, mke2fs.8.in, mke2fs.c:
authorTheodore Ts'o <tytso@mit.edu>
Sun, 14 Jan 2001 17:02:09 +0000 (17:02 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sun, 14 Jan 2001 17:02:09 +0000 (17:02 +0000)
  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.

misc/ChangeLog
misc/mke2fs.8.in
misc/mke2fs.c

index 042fbd7..8d85d4f 100644 (file)
@@ -1,5 +1,14 @@
 2001-01-14  Theodore Ts'o  <tytso@valinux.com>
 
+       * 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.
+
        * tune2fs.8.in: Add description of the -j option.
 
        * tune2fs.c (add_journal): Minor fixes from Andreas Dilger. Flush
index 99d209d..f8d5fe0 100644 (file)
@@ -268,8 +268,14 @@ is no guarantee that any data will be salvageable.
 .TP
 .BI \-T " fs-type"
 Specify how the filesystem is going to be used, so that mke2fs can 
-automatically determine the optimal filesystem parameters.  The only
-filesystem type which is currently supported is "news".
+chose optimal filesystem parameters for that use.  The only
+currently supported filesystem types are:
+.BR news ,
+which reserves space for  one inode per 4kb block,
+.BR largefile
+which allocates one inode per megabyte, and
+.BR largefile4
+which allocates one inode per 4 megabytes.  
 .TP
 .B \-V
 Print the version number of 
index b611065..b72ea1b 100644 (file)
@@ -137,6 +137,8 @@ struct mke2fs_defaults {
        { 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 @@ static void PRS(int argc, char *argv[])
                        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 @@ int main (int argc, char *argv[])
        ext2_filsys     fs;
        badblocks_list  bb_list = 0;
        int             journal_blocks;
+       int             i, val;
 
 #ifdef ENABLE_NLS
        setlocale(LC_MESSAGES, "");
@@ -956,6 +959,15 @@ int main (int argc, char *argv[])
        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)) {