summaryrefslogtreecommitdiff
path: root/src/automount.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2012-01-15 12:04:08 +0100
committerMichal Schmidt <mschmidt@redhat.com>2012-01-16 13:34:42 +0100
commitac155bb885f9ea8aac3979a6b2686f0c8a9cc6e3 (patch)
tree6d78545bae4ffd262ddf4fd71d17ded342c530ca /src/automount.c
parent7d17cfbc46306a106dbda0f3e92fbc0792d1e9e9 (diff)
unit: remove union Unit
Now that objects of all unit types are allocated the exact amount of memory they need, the Unit union has lost its purpose. Remove it. "Unit" is a more natural name for the base unit class than "Meta", so rename Meta to Unit. Access to members of the base class gets simplified.
Diffstat (limited to 'src/automount.c')
-rw-r--r--src/automount.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/automount.c b/src/automount.c
index c4191f6706..6858e56de3 100644
--- a/src/automount.c
+++ b/src/automount.c
@@ -52,7 +52,7 @@ static void automount_init(Unit *u) {
Automount *a = AUTOMOUNT(u);
assert(u);
- assert(u->meta.load_state == UNIT_STUB);
+ assert(u->load_state == UNIT_STUB);
a->pipe_watch.fd = a->pipe_fd = -1;
a->pipe_watch.type = WATCH_INVALID;
@@ -137,7 +137,7 @@ int automount_add_one_mount_link(Automount *a, Mount *m) {
}
static int automount_add_mount_links(Automount *a) {
- Meta *other;
+ Unit *other;
int r;
assert(a);
@@ -198,17 +198,17 @@ static int automount_load(Unit *u) {
Automount *a = AUTOMOUNT(u);
assert(u);
- assert(u->meta.load_state == UNIT_STUB);
+ assert(u->load_state == UNIT_STUB);
/* Load a .automount file */
if ((r = unit_load_fragment_and_dropin_optional(u)) < 0)
return r;
- if (u->meta.load_state == UNIT_LOADED) {
+ if (u->load_state == UNIT_LOADED) {
Unit *x;
if (!a->where)
- if (!(a->where = unit_name_to_path(u->meta.id)))
+ if (!(a->where = unit_name_to_path(u->id)))
return -ENOMEM;
path_kill_slashes(a->where);
@@ -263,7 +263,7 @@ static int automount_coldplug(Unit *u) {
if (a->deserialized_state != a->state) {
- if ((r = open_dev_autofs(u->meta.manager)) < 0)
+ if ((r = open_dev_autofs(u->manager)) < 0)
return r;
if (a->deserialized_state == AUTOMOUNT_WAITING ||
@@ -617,11 +617,11 @@ static int automount_start(Unit *u) {
assert(a->state == AUTOMOUNT_DEAD || a->state == AUTOMOUNT_FAILED);
if (path_is_mount_point(a->where, false)) {
- log_error("Path %s is already a mount point, refusing start for %s", a->where, u->meta.id);
+ log_error("Path %s is already a mount point, refusing start for %s", a->where, u->id);
return -EEXIST;
}
- if (UNIT_DEREF(a->mount)->meta.load_state != UNIT_LOADED)
+ if (UNIT_DEREF(a->mount)->load_state != UNIT_LOADED)
return -ENOENT;
a->failure = false;