#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>
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;
"[-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);
}
}
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);
exit(1);
}
break;
+ case 'D':
+ direct_io = 1;
+ break;
case 'g':
fs_param.s_blocks_per_group = strtoul(optarg, &tmp, 0);
if (*tmp) {
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++) {
* 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)
*/
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 {