diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-11-27 20:20:23 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-11-27 22:05:24 +0100 |
commit | 79008bddf679a5e0900369950eb346c9fa687107 (patch) | |
tree | 620eed51b44a64aa065c4184a4661c8c95c146e3 /src/core/automount.c | |
parent | e09ca588d25a0c383880d6c2f5b129296af781ab (diff) |
log: rearrange log function naming
- Rename log_meta() → log_internal(), to follow naming scheme of most
other log functions that are usually invoked through macros, but never
directly.
- Rename log_info_object() to log_object_info(), simply because the
object should be before any other parameters, to follow OO-style
programming style.
Diffstat (limited to 'src/core/automount.c')
-rw-r--r-- | src/core/automount.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/core/automount.c b/src/core/automount.c index f72aca2957..f874951f4c 100644 --- a/src/core/automount.c +++ b/src/core/automount.c @@ -151,7 +151,7 @@ static int automount_verify(Automount *a) { return 0; if (path_equal(a->where, "/")) { - log_error_unit(UNIT(a)->id, "Cannot have an automount unit for the root directory. Refusing."); + log_unit_error(UNIT(a)->id, "Cannot have an automount unit for the root directory. Refusing."); return -EINVAL; } @@ -162,7 +162,7 @@ static int automount_verify(Automount *a) { b = unit_has_name(UNIT(a), e); if (!b) { - log_error_unit(UNIT(a)->id, "%s's Where setting doesn't match unit name. Refusing.", UNIT(a)->id); + log_unit_error(UNIT(a)->id, "%s's Where setting doesn't match unit name. Refusing.", UNIT(a)->id); return -EINVAL; } @@ -226,7 +226,7 @@ static void automount_set_state(Automount *a, AutomountState state) { unmount_autofs(a); if (state != old_state) - log_debug_unit(UNIT(a)->id, + log_unit_debug(UNIT(a)->id, "%s changed %s -> %s", UNIT(a)->id, automount_state_to_string(old_state), @@ -422,9 +422,9 @@ int automount_send_ready(Automount *a, int status) { return ioctl_fd; if (status) - log_debug_unit(UNIT(a)->id, "Sending failure: %s", strerror(-status)); + log_unit_debug(UNIT(a)->id, "Sending failure: %s", strerror(-status)); else - log_debug_unit(UNIT(a)->id, "Sending success."); + log_unit_debug(UNIT(a)->id, "Sending success."); r = 0; @@ -536,7 +536,7 @@ fail: if (mounted) repeat_unmount(a->where); - log_error_unit(UNIT(a)->id, + log_unit_error(UNIT(a)->id, "Failed to initialize automounter: %s", strerror(-r)); automount_enter_dead(a, AUTOMOUNT_FAILURE_RESOURCES); } @@ -551,7 +551,7 @@ static void automount_enter_runnning(Automount *a) { /* We don't take mount requests anymore if we are supposed to * shut down anyway */ if (unit_stop_pending(UNIT(a))) { - log_debug_unit(UNIT(a)->id, + log_unit_debug(UNIT(a)->id, "Suppressing automount request on %s since unit stop is scheduled.", UNIT(a)->id); automount_send_ready(a, -EHOSTDOWN); return; @@ -561,19 +561,19 @@ static void automount_enter_runnning(Automount *a) { /* Before we do anything, let's see if somebody is playing games with us? */ if (lstat(a->where, &st) < 0) { - log_warning_unit(UNIT(a)->id, + log_unit_warning(UNIT(a)->id, "%s failed to stat automount point: %m", UNIT(a)->id); goto fail; } if (!S_ISDIR(st.st_mode) || st.st_dev != a->dev_id) - log_info_unit(UNIT(a)->id, + log_unit_info(UNIT(a)->id, "%s's automount point already active?", UNIT(a)->id); else { r = manager_add_job(UNIT(a)->manager, JOB_START, UNIT_TRIGGER(UNIT(a)), JOB_REPLACE, true, &error, NULL); if (r < 0) { - log_warning_unit(UNIT(a)->id, + log_unit_warning(UNIT(a)->id, "%s failed to queue mount startup job: %s", UNIT(a)->id, bus_error_message(&error, r)); goto fail; @@ -594,7 +594,7 @@ 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_unit(u->id, + log_unit_error(u->id, "Path %s is already a mount point, refusing start for %s", a->where, u->id); return -EEXIST; @@ -659,7 +659,7 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu state = automount_state_from_string(value); if (state < 0) - log_debug_unit(u->id, "Failed to parse state value %s", value); + log_unit_debug(u->id, "Failed to parse state value %s", value); else a->deserialized_state = state; } else if (streq(key, "result")) { @@ -667,7 +667,7 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu f = automount_result_from_string(value); if (f < 0) - log_debug_unit(u->id, "Failed to parse result value %s", value); + log_unit_debug(u->id, "Failed to parse result value %s", value); else if (f != AUTOMOUNT_SUCCESS) a->result = f; @@ -675,14 +675,14 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu unsigned d; if (safe_atou(value, &d) < 0) - log_debug_unit(u->id, "Failed to parse dev-id value %s", value); + log_unit_debug(u->id, "Failed to parse dev-id value %s", value); else a->dev_id = (unsigned) d; } else if (streq(key, "token")) { unsigned token; if (safe_atou(value, &token) < 0) - log_debug_unit(u->id, "Failed to parse token value %s", value); + log_unit_debug(u->id, "Failed to parse token value %s", value); else { if (!a->tokens) if (!(a->tokens = set_new(NULL))) @@ -696,13 +696,13 @@ static int automount_deserialize_item(Unit *u, const char *key, const char *valu int fd; if (safe_atoi(value, &fd) < 0 || fd < 0 || !fdset_contains(fds, fd)) - log_debug_unit(u->id, "Failed to parse pipe-fd value %s", value); + log_unit_debug(u->id, "Failed to parse pipe-fd value %s", value); else { safe_close(a->pipe_fd); a->pipe_fd = fdset_remove(fds, fd); } } else - log_debug_unit(u->id, "Unknown serialization key '%s'", key); + log_unit_debug(u->id, "Unknown serialization key '%s'", key); return 0; } @@ -738,13 +738,13 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo assert(fd == a->pipe_fd); if (events != EPOLLIN) { - log_error_unit(UNIT(a)->id, "Got invalid poll event on pipe."); + log_unit_error(UNIT(a)->id, "Got invalid poll event on pipe."); goto fail; } l = loop_read(a->pipe_fd, &packet, sizeof(packet), true); if (l != sizeof(packet)) { - log_error_unit(UNIT(a)->id, "Invalid read from pipe: %s", l < 0 ? strerror(-l) : "short read"); + log_unit_error(UNIT(a)->id, "Invalid read from pipe: %s", l < 0 ? strerror(-l) : "short read"); goto fail; } @@ -756,21 +756,21 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo _cleanup_free_ char *p = NULL; get_process_comm(packet.v5_packet.pid, &p); - log_info_unit(UNIT(a)->id, + log_unit_info(UNIT(a)->id, "Got automount request for %s, triggered by "PID_FMT" (%s)", a->where, packet.v5_packet.pid, strna(p)); } else - log_debug_unit(UNIT(a)->id, "Got direct mount request on %s", a->where); + log_unit_debug(UNIT(a)->id, "Got direct mount request on %s", a->where); r = set_ensure_allocated(&a->tokens, NULL); if (r < 0) { - log_error_unit(UNIT(a)->id, "Failed to allocate token set."); + log_unit_error(UNIT(a)->id, "Failed to allocate token set."); goto fail; } r = set_put(a->tokens, UINT_TO_PTR(packet.v5_packet.wait_queue_token)); if (r < 0) { - log_error_unit(UNIT(a)->id, "Failed to remember token: %s", strerror(-r)); + log_unit_error(UNIT(a)->id, "Failed to remember token: %s", strerror(-r)); goto fail; } @@ -778,7 +778,7 @@ static int automount_dispatch_io(sd_event_source *s, int fd, uint32_t events, vo break; default: - log_error_unit(UNIT(a)->id, "Received unknown automount request %i", packet.hdr.type); + log_unit_error(UNIT(a)->id, "Received unknown automount request %i", packet.hdr.type); break; } |