shutdown, umount: use verbs consistently
Mounts are "unmounted". Swaps are "deactivated", not "turned off" nor "disabled". Loop and DM devices are "detached", not "deleted". Especially the deleting sounded a bit scary.
This commit is contained in:
parent
bce93b7ac7
commit
735e071271
|
@ -207,15 +207,15 @@ int main(int argc, char *argv[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_swapoff) {
|
if (need_swapoff) {
|
||||||
log_info("Disabling swaps.");
|
log_info("Deactivating swaps.");
|
||||||
r = swapoff_all(&changed);
|
r = swapoff_all(&changed);
|
||||||
if (r == 0) {
|
if (r == 0) {
|
||||||
need_swapoff = false;
|
need_swapoff = false;
|
||||||
log_info("All swaps disabled.");
|
log_info("All swaps deactivated.");
|
||||||
} else if (r > 0)
|
} else if (r > 0)
|
||||||
log_info("Not all swaps are turned off, %d left.", r);
|
log_info("Not all swaps deactivated, %d left.", r);
|
||||||
else
|
else
|
||||||
log_error("Failed to turn off swaps: %s", strerror(-r));
|
log_error("Failed to deactivate swaps: %s", strerror(-r));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (need_loop_detach) {
|
if (need_loop_detach) {
|
||||||
|
|
|
@ -465,7 +465,7 @@ static int swap_points_list_off(MountPoint **head, bool *changed) {
|
||||||
assert(head);
|
assert(head);
|
||||||
|
|
||||||
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
|
LIST_FOREACH_SAFE(mount_point, m, n, *head) {
|
||||||
log_info("Disabling swap %s.", m->path);
|
log_info("Deactivating swap %s.", m->path);
|
||||||
if (swapoff(m->path) == 0) {
|
if (swapoff(m->path) == 0) {
|
||||||
if (changed)
|
if (changed)
|
||||||
*changed = true;
|
*changed = true;
|
||||||
|
@ -501,7 +501,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("Deleting loopback %s.", m->path);
|
log_info("Detaching loopback %s.", m->path);
|
||||||
r = delete_loopback(m->path);
|
r = delete_loopback(m->path);
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
if (r > 0 && changed)
|
if (r > 0 && changed)
|
||||||
|
@ -509,7 +509,7 @@ static int loopback_points_list_detach(MountPoint **head, bool *changed) {
|
||||||
|
|
||||||
mount_point_free(head, m);
|
mount_point_free(head, m);
|
||||||
} else {
|
} else {
|
||||||
log_warning("Could not delete loopback %s: %m", m->path);
|
log_warning("Could not detach loopback %s: %m", m->path);
|
||||||
n_failed++;
|
n_failed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,7 +536,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
log_info("Deleting DM %u:%u.", major(m->devnum), minor(m->devnum));
|
log_info("Detaching DM %u:%u.", major(m->devnum), minor(m->devnum));
|
||||||
r = delete_dm(m->devnum);
|
r = delete_dm(m->devnum);
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
if (changed)
|
if (changed)
|
||||||
|
@ -544,7 +544,7 @@ static int dm_points_list_detach(MountPoint **head, bool *changed) {
|
||||||
|
|
||||||
mount_point_free(head, m);
|
mount_point_free(head, m);
|
||||||
} else {
|
} else {
|
||||||
log_warning("Could not delete DM %s: %m", m->path);
|
log_warning("Could not detach DM %s: %m", m->path);
|
||||||
n_failed++;
|
n_failed++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue