| blkid_probe get_swap_prober(const char *devname) |
| const char *version = NULL; |
| char *swap_filter[] = { "swap", NULL }; |
| pr = blkid_new_probe_from_filename(devname); |
| warn(_("%s: unable to probe device"), devname); |
| blkid_probe_enable_superblocks(pr, TRUE); |
| blkid_probe_set_superblocks_flags(pr, |
| BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID | |
| blkid_probe_filter_superblocks_type(pr, BLKID_FLTR_ONLYIN, swap_filter); |
| rc = blkid_do_safeprobe(pr); |
| warn(_("%s: unable to probe device"), devname); |
| warnx(_("%s: ambiguous probing result; use wipefs(8)"), devname); |
| warnx(_("%s: not a valid swap partition"), devname); |
| /* Only the SWAPSPACE2 is supported. */ |
| if (blkid_probe_lookup_value(pr, "VERSION", &version, NULL) == 0 |
| && strcmp(version, stringify_value(SWAP_VERSION))) |
| warnx(_("%s: unsupported swap version '%s'"), |