io_flags = IO_FLAG_RW;
if (flags & EXT2_FLAG_EXCLUSIVE)
io_flags |= IO_FLAG_EXCLUSIVE;
+ if (flags & EXT2_FLAG_DIRECT_IO)
+ io_flags |= IO_FLAG_DIRECT_IO;
retval = manager->open(name, io_flags, &fs->io);
if (retval)
goto cleanup;
.I block-size
]
[
+.B \-D
+]
+[
.B \-f
.I fragment-size
]
this option is specified twice, then a slower read-write
test is used instead of a fast read-only test.
.TP
+.B \-D
+Use direct I/O when writing to the disk. This avoids mke2fs dirtying a
+lot of buffer cache memory, which may impact other applications running
+on a busy server. This option will cause mke2fs to run much more
+slowly, however, so there is a tradeoff to using direct I/O.
+.TP
.BI \-E " extended-options"
Set extended options for the filesystem. Extended options are comma
separated, and may take an argument using the equals ('=') sign. The
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) {
* 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)