From: Zbigniew Jędrzejewski-Szmek Date: Mon, 8 Nov 2021 11:12:58 +0000 (+0100) Subject: makefs: reindent mkfs calls to follow the same style X-Git-Tag: v250-rc1~240^2~9 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=44cdeb6e33d8d2c9f32e1c46ce402d5311ae6a0b;p=thirdparty%2Fsystemd.git makefs: reindent mkfs calls to follow the same style I think this also makes it much easier to see what args are passed. --- diff --git a/src/shared/mkfs-util.c b/src/shared/mkfs-util.c index 924afdfd930..b9c2f147bc1 100644 --- a/src/shared/mkfs-util.c +++ b/src/shared/mkfs-util.c @@ -75,23 +75,29 @@ int make_filesystem( "-I", "256", "-O", "has_journal", "-m", "0", - "-E", discard ? "lazy_itable_init=1,discard" : "lazy_itable_init=1,nodiscard", + "-E", discard ? "discard,lazy_itable_init=1" : "nodiscard,lazy_itable_init=1", node, NULL); else if (streq(fstype, "btrfs")) { - if (discard) - (void) execlp(mkfs, mkfs, "-L", label, "-U", ID128_TO_UUID_STRING(uuid), node, NULL); - else - (void) execlp(mkfs, mkfs, "-L", label, "-U", ID128_TO_UUID_STRING(uuid), "--nodiscard", node, NULL); + (void) execlp(mkfs, mkfs, + "-L", label, + "-U", ID128_TO_UUID_STRING(uuid), + node, + discard ? NULL : "--nodiscard", + NULL); } else if (streq(fstype, "xfs")) { const char *j; j = strjoina("uuid=", ID128_TO_UUID_STRING(uuid)); - if (discard) - (void) execlp(mkfs, mkfs, "-L", label, "-m", j, "-m", "reflink=1", node, NULL); - else - (void) execlp(mkfs, mkfs, "-L", label, "-m", j, "-m", "reflink=1", "-K", node, NULL); + + (void) execlp(mkfs, mkfs, + "-L", label, + "-m", j, + "-m", "reflink=1", + node, + discard ? NULL : "-K", + NULL); } else if (streq(fstype, "vfat")) { char mangled_label[8 + 3 + 1], vol_id[8 + 1];