]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mkfs-util: Don't explicitly enable has_journal for ext3/ext4
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 12 Mar 2023 14:36:08 +0000 (15:36 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Sun, 12 Mar 2023 14:36:08 +0000 (15:36 +0100)
It's enabled by default anyway and removing it allows merging the ext
conditionals into one.

src/shared/mkfs-util.c

index 33cb83343c4ece50e1dca03e4c22b97629727552..e073d66f3cb4d35319e56e67fce76c510343c8b6 100644 (file)
@@ -352,7 +352,7 @@ int make_filesystem(
                 assert_se(sd_id128_to_uuid_string(uuid, vol_id));
 
         /* When changing this conditional, also adjust the log statement below. */
-        if (streq(fstype, "ext2")) {
+        if (STR_IN_SET(fstype, "ext2", "ext3", "ext4")) {
                 argv = strv_new(mkfs,
                                 "-q",
                                 "-L", label,
@@ -363,24 +363,6 @@ int make_filesystem(
                                 "-b", "4096",
                                 "-T", "default",
                                 node);
-                if (!argv)
-                        return log_oom();
-
-                if (root && strv_extend_strv(&argv, STRV_MAKE("-d", root), false) < 0)
-                        return log_oom();
-
-        } else if (STR_IN_SET(fstype, "ext3", "ext4")) {
-                argv = strv_new(mkfs,
-                                "-q",
-                                "-L", label,
-                                "-U", vol_id,
-                                "-I", "256",
-                                "-O", "has_journal",
-                                "-m", "0",
-                                "-E", discard ? "discard,lazy_itable_init=1" : "nodiscard,lazy_itable_init=1",
-                                "-b", "4096",
-                                "-T", "default",
-                                node);
 
                 if (root && strv_extend_strv(&argv, STRV_MAKE("-d", root), false) < 0)
                         return log_oom();