summaryrefslogtreecommitdiff
path: root/src/gpt-auto-generator
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-10-14 15:46:04 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-10-17 08:07:58 +0200
commit235ae69cbeb37f52eb96e8cbf8fc9d5738e91465 (patch)
tree0673b146da500f96c322de9efa20594792f2cc63 /src/gpt-auto-generator
parente8ede6f57e49531a820b5ddc05ddade661b5832c (diff)
downloadsystemd-235ae69cbeb37f52eb96e8cbf8fc9d5738e91465.tar.gz
gpt-auto: rename all functions that operate on a DissectedPartition object add_partition_xyz()
The function for handling regular mounts based on DissectedPartition objects is called add_partition_mount(), so let's follow this scheme for all other functions that handle them, too. This nicely separates out the low-level functions (which get split up args) from the high-level functions (which get a DissectedPartition object): the latter are called add_partition_xyz() the former just add_xyz(). This makes naming a bit more systematic. No change in behaviour.
Diffstat (limited to 'src/gpt-auto-generator')
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 7df75e1333..0fb53bb9ea 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -282,7 +282,7 @@ static int add_partition_mount(
SPECIAL_LOCAL_FS_TARGET);
}
-static int add_swap(DissectedPartition *p) {
+static int add_partition_swap(DissectedPartition *p) {
const char *what;
_cleanup_free_ char *name = NULL, *unit = NULL, *crypto_what = NULL;
_cleanup_fclose_ FILE *f = NULL;
@@ -424,7 +424,7 @@ static const char *esp_or_xbootldr_options(const DissectedPartition *p) {
return NULL;
}
-static int add_xbootldr(DissectedPartition *p) {
+static int add_partition_xbootldr(DissectedPartition *p) {
int r;
assert(p);
@@ -460,7 +460,7 @@ static int add_xbootldr(DissectedPartition *p) {
}
#if ENABLE_EFI
-static int add_esp(DissectedPartition *p, bool has_xbootldr) {
+static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) {
const char *esp_path = NULL, *id = NULL;
int r;
@@ -534,12 +534,12 @@ static int add_esp(DissectedPartition *p, bool has_xbootldr) {
120 * USEC_PER_SEC);
}
#else
-static int add_esp(DissectedPartition *p, bool has_xbootldr) {
+static int add_partition_esp(DissectedPartition *p, bool has_xbootldr) {
return 0;
}
#endif
-static int add_root_rw(DissectedPartition *p) {
+static int add_partition_root_rw(DissectedPartition *p) {
const char *path;
int r;
@@ -606,9 +606,8 @@ static int add_root_mount(void) {
} else if (r < 0)
return log_error_errno(r, "Failed to read ESP partition UUID: %m");
- /* OK, we have an ESP partition, this is fantastic, so let's
- * wait for a root device to show up. A udev rule will create
- * the link for us under the right name. */
+ /* OK, we have an ESP partition, this is fantastic, so let's wait for a root device to show up. A
+ * udev rule will create the link for us under the right name. */
if (in_initrd()) {
r = generator_write_initrd_root_device_deps(arg_dest, "/dev/gpt-auto-root");
@@ -675,19 +674,19 @@ static int enumerate_partitions(dev_t devnum) {
return log_error_errno(r, "Failed to dissect: %m");
if (m->partitions[PARTITION_SWAP].found) {
- k = add_swap(m->partitions + PARTITION_SWAP);
+ k = add_partition_swap(m->partitions + PARTITION_SWAP);
if (k < 0)
r = k;
}
if (m->partitions[PARTITION_XBOOTLDR].found) {
- k = add_xbootldr(m->partitions + PARTITION_XBOOTLDR);
+ k = add_partition_xbootldr(m->partitions + PARTITION_XBOOTLDR);
if (k < 0)
r = k;
}
if (m->partitions[PARTITION_ESP].found) {
- k = add_esp(m->partitions + PARTITION_ESP, m->partitions[PARTITION_XBOOTLDR].found);
+ k = add_partition_esp(m->partitions + PARTITION_ESP, m->partitions[PARTITION_XBOOTLDR].found);
if (k < 0)
r = k;
}
@@ -717,7 +716,7 @@ static int enumerate_partitions(dev_t devnum) {
}
if (m->partitions[PARTITION_ROOT].found) {
- k = add_root_rw(m->partitions + PARTITION_ROOT);
+ k = add_partition_root_rw(m->partitions + PARTITION_ROOT);
if (k < 0)
r = k;
}