mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 00:47:10 +09:00
This refactors the Unit structure a bit: all cgroup-related state fields
are moved to a new structure CGroupRuntime, which is only allocated as
we realize a cgroup.
This is both a nice cleanup and should make unit structures considerably
smaller that have no cgroup associated, because never realized or
because they belong to a unit type that doesn#t have cgroups anyway.
This makes things nicely symmetric:
ExecContext → static user configuration about execution
ExecRuntime → dynamic user state of execution
CGroupContext → static user configuration about cgroups
CGroupRuntime → dynamic user state of cgroups
And each time the XyzContext is part of the unit type structures such as
Service or Slice that need it, but the runtime object is only allocated
when a unit is started.
21 lines
341 B
C
21 lines
341 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include "unit.h"
|
|
|
|
typedef struct Slice Slice;
|
|
|
|
struct Slice {
|
|
Unit meta;
|
|
|
|
SliceState state, deserialized_state;
|
|
|
|
CGroupContext cgroup_context;
|
|
|
|
CGroupRuntime *cgroup_runtime;
|
|
};
|
|
|
|
extern const UnitVTable slice_vtable;
|
|
|
|
DEFINE_CAST(SLICE, Slice);
|