]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
repart: Inline Partition and Context typedefs
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 24 Nov 2022 09:05:32 +0000 (10:05 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 29 Nov 2022 09:08:51 +0000 (10:08 +0100)
src/partition/repart.c

index 26f1519edcf8d653857b07c430c6cb9c8ff58a21..e3d9e4f66108415596bae323fa3bcb072c3bbf33 100644 (file)
@@ -158,9 +158,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_tpm2_device, freep);
 STATIC_DESTRUCTOR_REGISTER(arg_tpm2_public_key, freep);
 STATIC_DESTRUCTOR_REGISTER(arg_filter_partitions, freep);
 
-typedef struct Partition Partition;
 typedef struct FreeArea FreeArea;
-typedef struct Context Context;
 
 typedef enum EncryptMode {
         ENCRYPT_OFF,
@@ -180,7 +178,7 @@ typedef enum VerityMode {
         _VERITY_MODE_INVALID = -EINVAL,
 } VerityMode;
 
-struct Partition {
+typedef struct Partition {
         char *definition_path;
         char **drop_in_files;
 
@@ -236,10 +234,10 @@ struct Partition {
         char *split_name_format;
         char *split_path;
 
-        Partition *siblings[_VERITY_MODE_MAX];
+        struct Partition *siblings[_VERITY_MODE_MAX];
 
-        LIST_FIELDS(Partition, partitions);
-};
+        LIST_FIELDS(struct Partition, partitions);
+} Partition;
 
 #define PARTITION_IS_FOREIGN(p) (!(p)->definition_path)
 #define PARTITION_EXISTS(p) (!!(p)->current_partition)
@@ -250,7 +248,7 @@ struct FreeArea {
         uint64_t allocated;
 };
 
-struct Context {
+typedef struct Context {
         LIST_HEAD(Partition, partitions);
         size_t n_partitions;
 
@@ -269,7 +267,7 @@ struct Context {
         int backing_fd;
 
         bool from_scratch;
-};
+} Context;
 
 static const char *encrypt_mode_table[_ENCRYPT_MODE_MAX] = {
         [ENCRYPT_OFF] = "off",