1 --- util-linux-2.12a/mount/mount_by_label.c.old 2004-08-11 22:25:06.000000000 +0100
2 +++ util-linux-2.12a/mount/mount_by_label.c 2004-08-11 22:25:21.000000000 +0100
4 * - Added JFS v2 format support
5 * 2002-07-26 Luciano Chavez <lnx1138@us.ibm.com>
7 + * 2004-08-11 Alasdair Kergon <agk@redhat.com>
8 + * - Added LVM2/device-mapper support
13 #define VG_DIR "/proc/lvm/VGs"
14 #define EVMS_VOLUME_NAME_SIZE 127
15 #define PROC_EVMS_VOLUMES "/proc/evms/volumes"
16 +#define DEVICEMAPPERDIR "/dev/mapper"
18 static struct uuidCache_s {
19 struct uuidCache_s *next;
24 +/* LVM2/device-mapper support */
26 +uuidcache_init_dm(void) {
27 + char lvm_device[PATH_MAX];
29 + struct dirent *lv_iter;
30 + char uuid[16], *label;
32 + if (!(d = opendir(DEVICEMAPPERDIR))) {
33 + if (errno != ENOENT)
34 + perror("mount (init_dm)");
38 + while ((lv_iter = readdir(d))) {
39 + if (!strcmp(lv_iter->d_name, "control") ||
40 + !strcmp(lv_iter->d_name, ".") ||
41 + !strcmp(lv_iter->d_name, ".."))
43 + snprintf(lvm_device, sizeof(lvm_device), "%s/%s",
44 + DEVICEMAPPERDIR, lv_iter->d_name);
45 + if (!get_label_uuid(strdup(lvm_device), &label, uuid))
46 + uuidcache_addentry(strdup(lvm_device),
53 uuidcache_init_evms(void) {
60 + uuidcache_init_dm();