summaryrefslogtreecommitdiffstats
path: root/mount/swapon.c
diff options
context:
space:
mode:
authorKarel Zak2009-02-17 01:01:35 +0100
committerKarel Zak2009-02-17 01:18:22 +0100
commit17f29d7bac86dc6e42c8ea728a2b7d1dc873b3dc (patch)
tree60261cb64ad167a98e193f43e7e9f23de2319349 /mount/swapon.c
parentblkid: add Christoph's note about libdisk to TODO (diff)
downloadkernel-qcow2-util-linux-17f29d7bac86dc6e42c8ea728a2b7d1dc873b3dc.tar.gz
kernel-qcow2-util-linux-17f29d7bac86dc6e42c8ea728a2b7d1dc873b3dc.tar.xz
kernel-qcow2-util-linux-17f29d7bac86dc6e42c8ea728a2b7d1dc873b3dc.zip
mount: generic blkid/volume_id wrapper, use blkid_evaluate_*
* moves the generic libblkid/libvolume_id wrapper (fsprobe.c) from mount/ to lib/. We'll use the wrapper in cfdisk and fsck. The wrapper supports: - obsolete volume_id (udev) - obsolete libblkid (e2fsprogs) - libblkid (util-linux-ng) * mount, umount and swapon when linked against the new libblkid use - low-level probing code to read LABEL, UUID or FSTYPE from a device - high-level blkid_evaluate_spec() to convert LABEL/UUID to devname Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'mount/swapon.c')
-rw-r--r--mount/swapon.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/mount/swapon.c b/mount/swapon.c
index c50c32ae5..8cdb7fb18 100644
--- a/mount/swapon.c
+++ b/mount/swapon.c
@@ -20,6 +20,7 @@
#include "swap_constants.h"
#include "nls.h"
#include "fsprobe.h"
+#include "devname.h"
#include "pathnames.h"
#include "sundries.h"
#include "swapheader.h"
@@ -362,7 +363,7 @@ do_swapon(const char *orig_special, int prio, int canonic) {
printf(_("%s on %s\n"), progname, orig_special);
if (!canonic) {
- special = fsprobe_get_devname(orig_special);
+ special = spec_to_devname(orig_special);
if (!special)
return cannot_find(orig_special);
}
@@ -475,7 +476,7 @@ do_swapoff(const char *orig_special, int quiet, int canonic) {
printf(_("%s on %s\n"), progname, orig_special);
if (!canonic) {
- special = fsprobe_get_devname(orig_special);
+ special = spec_to_devname(orig_special);
if (!special)
return cannot_find(orig_special);
}
@@ -546,7 +547,7 @@ swapon_all(void) {
if (skip)
continue;
- special = fsprobe_get_devname(fstab->mnt_fsname);
+ special = spec_to_devname(fstab->mnt_fsname);
if (!special) {
if (!ifexists)
status |= cannot_find(fstab->mnt_fsname);
@@ -727,7 +728,7 @@ main_swapoff(int argc, char *argv[]) {
if (!streq(fstab->mnt_type, MNTTYPE_SWAP))
continue;
- special = fsprobe_get_devname(fstab->mnt_fsname);
+ special = spec_to_devname(fstab->mnt_fsname);
if (!special)
continue;