char *fsprobe_get_devname_by_spec(const char *spec) { char *name, *value; if (!spec) return NULL; if (fsprobe_parse_spec(spec, &name, &value) != 0) return NULL; /* parse error */ if (name) { char *nspec = NULL; if (!strcmp(name,"LABEL")) nspec = fsprobe_get_devname_by_label(value); free(name); free(value); return nspec; } return canonicalize_path(spec); }
static int swapoff_by_label(const char *label, int quiet) { const char *special = fsprobe_get_devname_by_label(label); return special ? do_swapoff(special, quiet, CANONIC) : cannot_find(label); }
static int swapon_by_label(const char *label, int prio, int dsc) { const char *special = fsprobe_get_devname_by_label(label); return special ? do_swapon(special, prio, dsc, CANONIC) : cannot_find(label); }