chiark / gitweb /
pahole: rearrange structs to make them smaller
authorLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 20:37:10 +0000 (22:37 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 11 Aug 2010 20:37:10 +0000 (22:37 +0200)
src/automount.h
src/device.h
src/execute.h
src/manager.h
src/mount.h
src/socket.h
src/swap.h
src/timer.h
src/unit.h

index 13b56effb6fa96204ea503fc830885e7337e5774..4f879f4085f451129fb33464eb5c898876577d73 100644 (file)
@@ -45,10 +45,10 @@ struct Automount {
         Mount *mount;
 
         int pipe_fd;
+        mode_t directory_mode;
         Watch pipe_watch;
         dev_t dev_id;
 
-        mode_t directory_mode;
 
         Set *tokens;
 
index 5757c9139d9470e7ec1a74ed5d7e88b45477a409..515db65644b144c42fe9d568e87a3d14aa0e29b6 100644 (file)
@@ -38,8 +38,6 @@ typedef enum DeviceState {
 struct Device {
         Meta meta;
 
-        DeviceState state;
-
         char *sysfs;
 
         /* In order to be able to distuingish dependencies on
@@ -47,6 +45,8 @@ struct Device {
         devices for the same sysfs path. We chain them up here. */
 
         LIST_FIELDS(struct Device, same_sysfs);
+
+        DeviceState state;
 };
 
 extern const UnitVTable device_vtable;
index 4b3449e2652222179ecb47f42b638ccb6d473b21..5410f83561203f05276416e571b1735136b80f54 100644 (file)
@@ -87,8 +87,8 @@ struct ExecCommand {
         char *path;
         char **argv;
         ExecStatus exec_status;
-        bool ignore;
         LIST_FIELDS(ExecCommand, command); /* useful for chaining commands */
+        bool ignore;
 };
 
 struct ExecContext {
@@ -105,15 +105,12 @@ struct ExecContext {
 
         cpu_set_t *cpuset;
         unsigned cpuset_ncpus;
-        unsigned long timer_slack_nsec;
 
         ExecInput std_input;
         ExecOutput std_output;
         ExecOutput std_error;
 
-        int syslog_priority;
-        char *syslog_identifier;
-        bool syslog_level_prefix;
+        unsigned long timer_slack_nsec;
 
         char *tcpwrap_name;
 
@@ -134,19 +131,21 @@ struct ExecContext {
 
         uint64_t capability_bounding_set_drop;
 
+        /* Not relevant for spawning processes, just for killing */
+        KillMode kill_mode;
+        int kill_signal;
+
         cap_t capabilities;
         int secure_bits;
 
+        int syslog_priority;
+        char *syslog_identifier;
+        bool syslog_level_prefix;
+
         bool cpu_sched_reset_on_fork;
         bool non_blocking;
         bool private_tmp;
 
-        bool oom_adjust_set:1;
-        bool nice_set:1;
-        bool ioprio_set:1;
-        bool cpu_sched_set:1;
-        bool timer_slack_nsec_set:1;
-
         /* This is not exposed to the user but available
          * internally. We need it to make sure that whenever we spawn
          * /bin/mount it is run in the same process group as us so
@@ -154,9 +153,11 @@ struct ExecContext {
          * don't enter a trigger loop. */
         bool same_pgrp;
 
-        /* Not relevant for spawning processes, just for killing */
-        KillMode kill_mode;
-        int kill_signal;
+        bool oom_adjust_set:1;
+        bool nice_set:1;
+        bool ioprio_set:1;
+        bool cpu_sched_set:1;
+        bool timer_slack_nsec_set:1;
 };
 
 typedef enum ExitStatus {
index c1f787f8544dba1d836be096e83e59fc4c6c6995..ef40352d5979897cda4c33930a2aa069e2968b48 100644 (file)
@@ -87,8 +87,6 @@ struct Watch {
 #include "path-lookup.h"
 
 struct Manager {
-        uint32_t current_job_id;
-
         /* Note that the set of units we know of is allowed to be
          * incosistent. However the subset of it that is loaded may
          * not, and the list of jobs may neither. */
@@ -170,6 +168,8 @@ struct Manager {
         int32_t name_data_slot;
         int32_t subscribed_data_slot;
 
+        uint32_t current_job_id;
+
         /* Data specific to the Automount subsystem */
         int dev_autofs_fd;
 
@@ -198,11 +198,11 @@ struct Manager {
         bool dispatching_run_queue:1;
         bool dispatching_dbus_queue:1;
 
-        int n_deserializing;
-
         bool show_status;
         bool confirm_spawn;
         bool sysv_console;
+
+        int n_deserializing;
 };
 
 int manager_new(ManagerRunningAs running_as, Manager **m);
index 6c60167deb96bdeab9ecfd0fe4d422004d2785af..56a7b12b26bce20266f0fca1bdb91ed04f6753de 100644 (file)
@@ -79,10 +79,10 @@ struct Mount {
 
         bool failure:1;
 
-        usec_t timeout_usec;
-
         mode_t directory_mode;
 
+        usec_t timeout_usec;
+
         ExecCommand exec_command[_MOUNT_EXEC_COMMAND_MAX];
         ExecContext exec_context;
 
index 230dd200d5e423ebef41f869ec3f6555d5b0c0c1..89fa6cca7184f4adf44a8ffa3635460976806b53 100644 (file)
@@ -78,6 +78,10 @@ struct Socket {
 
         LIST_HEAD(SocketPort, ports);
 
+        unsigned n_accepted;
+        unsigned n_connections;
+        unsigned max_connections;
+
         unsigned backlog;
         usec_t timeout_usec;
 
@@ -91,36 +95,34 @@ struct Socket {
 
         SocketState state, deserialized_state;
 
+        Watch timer_watch;
+
         ExecCommand* control_command;
         SocketExecCommand control_command_id;
         pid_t control_pid;
 
-        bool accept;
-        unsigned n_accepted;
-        unsigned n_connections;
-        unsigned max_connections;
+        /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
+        SocketAddressBindIPv6Only bind_ipv6_only;
+
+        mode_t directory_mode;
+        mode_t socket_mode;
 
         bool failure;
-        Watch timer_watch;
+
+        bool accept;
 
         /* Socket options */
         bool keep_alive;
+        bool free_bind;
         int priority;
+        int mark;
         size_t receive_buffer;
         size_t send_buffer;
         int ip_tos;
         int ip_ttl;
         size_t pipe_size;
-        int mark;
-        bool free_bind;
         char *bind_to_device;
         char *tcp_congestion;
-
-        /* Only for INET6 sockets: issue IPV6_V6ONLY sockopt */
-        SocketAddressBindIPv6Only bind_ipv6_only;
-
-        mode_t directory_mode;
-        mode_t socket_mode;
 };
 
 /* Called from the service code when collecting fds */
index d3f24d5cbac50b9899a1de74b02c46b8ad85a916..154d418d59505b9b49c52b6298a99e8d83ffcc16 100644 (file)
@@ -51,11 +51,11 @@ struct Swap {
 
         char *what;
 
+        SwapState state, deserialized_state;
+
         bool from_etc_fstab:1;
         bool from_proc_swaps:1;
         bool from_fragment:1;
-
-        SwapState state, deserialized_state;
 };
 
 extern const UnitVTable swap_vtable;
index 6510ed2844a19ff73e3eddc1a18811ded6b1ace0..fc74368e738ce20ab74b31258b10d6ad795364e2 100644 (file)
@@ -47,14 +47,13 @@ typedef enum TimerBase {
 } TimerBase;
 
 typedef struct TimerValue {
-        TimerBase base;
         usec_t value;
-
         usec_t next_elapse;
 
-        bool disabled;
-
         LIST_FIELDS(struct TimerValue, value);
+
+        TimerBase base;
+        bool disabled;
 } TimerValue;
 
 struct Timer {
index 82ef95245185121404bd2d0b49157aeccb990441..e3ca8bbca6f6d014488dc0313ad2486d3a9f3ce2 100644 (file)
@@ -180,6 +180,10 @@ struct Meta {
         /* Used during GC sweeps */
         unsigned gc_marker;
 
+        /* When deserializing, temporarily store the job type for this
+         * unit here, if there was a job scheduled */
+        int deserialized_job; /* This is actually of type JobType */
+
         /* If we go down, pull down everything that depends on us, too */
         bool recursive_stop;
 
@@ -198,10 +202,6 @@ struct Meta {
         /* Don't allow the user to stop this unit manually, allow stopping only indirectly via dependency. */
         bool refuse_manual_stop;
 
-        /* When deserializing, temporarily store the job type for this
-         * unit here, if there was a job scheduled */
-        int deserialized_job; /* This is actually of type JobType */
-
         bool in_load_queue:1;
         bool in_dbus_queue:1;
         bool in_cleanup_queue:1;