Whamcloud - gitweb
e2fsck: track errors/badness found for each inode
[tools/e2fsprogs.git] / misc / mke2fs.c
index c70c1b4..7ec8cc2 100644 (file)
@@ -43,9 +43,6 @@ extern int optind;
 #ifdef HAVE_ERRNO_H
 #include <errno.h>
 #endif
-#ifdef HAVE_MNTENT_H
-#include <mntent.h>
-#endif
 #include <sys/ioctl.h>
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -88,6 +85,7 @@ int   verbose;
 int    quiet;
 int    super_only;
 int    discard = 1;    /* attempt to discard device before fs creation */
+int    direct_io;
 int    force;
 int    noaction;
 int    journal_size;
@@ -122,7 +120,7 @@ static void usage(void)
        "[-M last-mounted-directory]\n\t[-O feature[,...]] "
        "[-r fs-revision] [-E extended-option[,...]]\n"
        "\t[-t fs-type] [-T usage-type ] [-U UUID] "
-       "[-jnqvFKSV] device [blocks-count]\n"),
+       "[-jnqvDFKSV] device [blocks-count]\n"),
                program_name);
        exit(1);
 }
@@ -1321,7 +1319,7 @@ profile_error:
        }
 
        while ((c = getopt (argc, argv,
-                   "b:cg:i:jl:m:no:qr:s:t:vC:E:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
+                   "b:cg:i:jl:m:no:qr:s:t:vC:DE:FG:I:J:KL:M:N:O:R:ST:U:V")) != EOF) {
                switch (c) {
                case 'b':
                        blocksize = strtol(optarg, &tmp, 0);
@@ -1354,6 +1352,9 @@ profile_error:
                                exit(1);
                        }
                        break;
+               case 'D':
+                       direct_io = 1;
+                       break;
                case 'g':
                        fs_param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
                        if (*tmp) {
@@ -1896,6 +1897,7 @@ profile_error:
        journal_flags |= get_bool_from_profile(fs_types,
                                               "lazy_journal_init", 0) ?
                                               EXT2_MKJOURNAL_LAZYINIT : 0;
+       journal_flags |= EXT2_MKJOURNAL_NO_MNT_CHECK;
 
        /* Get options from profile */
        for (cpp = fs_types; *cpp; cpp++) {
@@ -2257,6 +2259,8 @@ int main (int argc, char *argv[])
         * Initialize the superblock....
         */
        flags = EXT2_FLAG_EXCLUSIVE;
+       if (direct_io)
+               flags |= EXT2_FLAG_DIRECT_IO;
        profile_get_boolean(profile, "options", "old_bitmaps", 0, 0,
                            &old_bitmaps);
        if (!old_bitmaps)
@@ -2442,7 +2446,7 @@ int main (int argc, char *argv[])
                 */
                if (fs->super->s_feature_ro_compat &
                    EXT4_FEATURE_RO_COMPAT_GDT_CSUM) {
-                       for (i = 1; i < fs->group_desc_count; i++)
+                       for (i = 0; i < fs->group_desc_count; i++)
                                ext2fs_bg_itable_unused_set(fs, i, 0);
                }
        } else {