int do_swapoff_label (const char *label) { if (strlen (label) > SWAP_LABEL_MAX) { reply_with_error ("%s: Linux swap labels are limited to %d bytes", label, SWAP_LABEL_MAX); return -1; } return swaponoff ("swapoff", "-L", label); }
int do_swapoff_file (const char *path) { CLEANUP_FREE char *buf = NULL; buf = sysroot_path (path); if (!buf) { reply_with_perror ("malloc"); return -1; } return swaponoff ("swapoff", NULL, buf); }
int do_swapoff_uuid (const char *uuid) { return swaponoff ("swapoff", "-U", uuid); }
int do_swapoff_device (const char *device) { return swaponoff ("swapoff", NULL, device); }
int do_swapoff_uuid (const char *uuid) { return swaponoff (str_swapoff, "-U", uuid); }
int do_swapon_device (const char *device) { return swaponoff (str_swapon, NULL, device); }