static int has_uuid(const char *device, const char *uuid){ const char *devuuid; int ret; devuuid = mount_get_devname_by_uuid(device); ret = !strcmp(uuid, devuuid); /* free(devuuid); */ return ret; }
const char * mount_get_devname_for_mounting(const char *spec) { const char *nspec; if (!strncmp(spec, "UUID=", 5)) { nspec = mount_get_devname_by_uuid(spec+5); if (nspec && verbose > 1) printf(_("mount: going to mount %s by UUID\n"), spec); } else if (!strncmp(spec, "LABEL=", 6)) { nspec = mount_get_devname_by_label(spec+6); if (nspec && verbose > 1) printf(_("mount: going to mount %s by label\n"), spec); } else nspec = spec; return nspec; }
static int swapoff_by_uuid(const char *uuid, int quiet) { const char *special = mount_get_devname_by_uuid(uuid); return special ? do_swapoff(special, quiet) : cannot_find(uuid); }
static int swapon_by_uuid(const char *uuid, int prio) { const char *special = mount_get_devname_by_uuid(uuid); return special ? do_swapon(special, prio) : cannot_find(uuid); }