pahole: rearrange structs to make them smaller

This commit is contained in:
Lennart Poettering 2010-08-11 22:37:10 +02:00
parent e364ad0628
commit 7fab9d01b5
9 changed files with 56 additions and 54 deletions

View 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;

View 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;

View 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 {

View 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);

View 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;

View 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;
bool failure;
Watch timer_watch;
/* Socket options */
bool keep_alive;
int priority;
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;
bool failure;
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;
char *bind_to_device;
char *tcp_congestion;
};
/* Called from the service code when collecting fds */

View 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;

View 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 {

View 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;