summaryrefslogtreecommitdiffstats
path: root/mount/devname.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/devname.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/devname.c')
-rw-r--r--mount/devname.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mount/devname.c b/mount/devname.c
new file mode 100644
index 000000000..585d259ff
--- /dev/null
+++ b/mount/devname.c
@@ -0,0 +1,15 @@
+#include "fsprobe.h"
+
+#include "devname.h"
+#include "sundries.h" /* for xstrdup */
+
+const char *
+spec_to_devname(const char *spec)
+{
+ if (!spec)
+ return NULL;
+ if (is_pseudo_fs(spec))
+ return xstrdup(spec);
+ return fsprobe_get_devname_by_spec(spec);
+}
+