Whamcloud - gitweb
Add check for mkfs.ext3 and create a journal in this case.
authorAndreas Dilger <adilger@clusterfs.com>
Tue, 26 Feb 2002 06:11:26 +0000 (23:11 -0700)
committerAndreas Dilger <adilger@clusterfs.com>
Tue, 26 Feb 2002 06:11:26 +0000 (23:11 -0700)
e2fsprogs.spec
misc/ChangeLog
misc/mke2fs.8.in
misc/mke2fs.c
misc/tune2fs.c
misc/util.c
misc/util.h

index 47f664f..a42b34b 100644 (file)
@@ -86,6 +86,7 @@ fi
 /sbin/fsck.ext3
 /sbin/mke2fs
 /sbin/mkfs.ext2
+/sbin/mkfs.ext3
 /sbin/tune2fs
 /sbin/resize2fs
 /usr/sbin/mklost+found
index 012d228..e33f616 100644 (file)
@@ -1,3 +1,8 @@
+2002-02-25  Andreas Dilger  <adilger@clusterfs.com>
+
+       * mke2fs.c: Add check for mkfs.ext3 and create a journal in
+               this case.
+
 2002-02-24  Theodore Tso  <tytso@valinux.com>
 
        * Makefile.in (install): Install hard links for man pages for
index 59fa974..ce2a415 100644 (file)
@@ -128,7 +128,11 @@ is the special file corresponding to the device (e.g
 .I blocks-count
 is the number of blocks on the device.  If omitted,
 .B mke2fs
-automagically figures the file system size.
+automagically figures the file system size.  If called as
+.B mkfs.ext3
+a journal is created as if the
+.B \-j
+option was specified.
 .SH OPTIONS
 .TP
 .BI \-b " block-size"
index c55aab0..307ad2f 100644 (file)
@@ -820,8 +820,15 @@ static void PRS(int argc, char *argv[])
 #endif
        fprintf (stderr, "mke2fs %s (%s)\n",
                 E2FSPROGS_VERSION, E2FSPROGS_DATE);
-       if (argc && *argv)
-               program_name = *argv;
+
+       if (argc && *argv) {
+               program_name = get_progname(*argv);
+
+               /* If called as mkfs.ext3, create a journal inode */
+               if (!strcmp(program_name, "mkfs.ext3"))
+                       journal_size = -1;
+       }
+
        while ((c = getopt (argc, argv,
                    "b:cf:g:i:jl:m:no:qr:R:s:tvI:J:ST:FL:M:N:O:V")) != EOF)
                switch (c) {
index 8c27a70..3d9f911 100644 (file)
@@ -390,20 +390,6 @@ err:
        exit(1);
 }
 
-/*
- * Given argv[0], return the program name.
- */
-static char *get_progname(char *argv_zero)
-{
-       char    *cp;
-
-       cp = strrchr(argv_zero, '/');
-       if (!cp )
-               return argv_zero;
-       else
-               return cp+1;
-}
-
 
 static void parse_e2label_options(int argc, char ** argv)
 {
index 4bffb43..42e78b6 100644 (file)
@@ -48,6 +48,20 @@ int strcasecmp (char *s1, char *s2)
 }
 #endif
 
+/*
+ * Given argv[0], return the program name.
+ */
+char *get_progname(char *argv_zero)
+{
+       char    *cp;
+
+       cp = strrchr(argv_zero, '/');
+       if (!cp )
+               return argv_zero;
+       else
+               return cp+1;
+}
+
 void proceed_question(void)
 {
        char buf[256];
index d3cc9e6..3b6a881 100644 (file)
@@ -17,6 +17,7 @@ extern char   *journal_device;
 #ifndef HAVE_STRCASECMP
 extern int strcasecmp (char *s1, char *s2);
 #endif
+extern char *get_progname(char *argv_zero);
 extern void proceed_question(void);
 extern void check_plausibility(const char *device);
 extern void parse_journal_opts(const char *opts);