probe: stop handling name property
authorJo-Philipp Wich <jo@mein.io>
Mon, 17 Oct 2016 11:10:07 +0000 (13:10 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 17 Oct 2016 11:10:07 +0000 (13:10 +0200)
In the full liblkid there is no tag called "NAME" and the name value reported
by libblkid-tiny was just the kind of uuid passed to blkid_probe_set_uuid_as().

Strip any handling of this property to allow removing it from libblkid-tiny.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
probe-libblkid.c
probe.c
probe.h

index c4488885d97ad2b6d16f0621379bd880ffece0e4..ad9f371f5fc2f5fcfbb285ab2b730d657a06b886 100644 (file)
@@ -55,9 +55,9 @@ probe_path_libblkid(const char *path)
 {
        blkid_probe pr;
        struct probe_info *info = NULL;
-       size_t type_len, uuid_len, label_len, name_len, version_len;
-       char *dev_ptr, *type_ptr, *uuid_ptr, *label_ptr, *name_ptr, *version_ptr;
-       const char *type_val, *uuid_val, *label_val, *name_val, *version_val;
+       size_t type_len, uuid_len, label_len, version_len;
+       char *dev_ptr, *type_ptr, *uuid_ptr, *label_ptr, *version_ptr;
+       const char *type_val, *uuid_val, *label_val, *version_val;
 
        if (!load_libblkid())
                return NULL;
@@ -77,9 +77,6 @@ probe_path_libblkid(const char *path)
                if (libblkid.lookup(pr, "LABEL", &label_val, &label_len))
                        label_len = 0;
 
-               if (libblkid.lookup(pr, "NAME", &name_val, &name_len))
-                       name_len = 0;
-
                if (libblkid.lookup(pr, "VERSION", &version_val, &version_len))
                        version_len = 0;
 
@@ -89,7 +86,6 @@ probe_path_libblkid(const char *path)
                                        &type_ptr,    type_len,
                                        &uuid_ptr,    uuid_len,
                                        &label_ptr,   label_len,
-                                       &name_ptr,    name_len,
                                        &version_ptr, version_len);
 
                        if (info) {
@@ -102,9 +98,6 @@ probe_path_libblkid(const char *path)
                                if (label_len)
                                        info->label = strcpy(label_ptr, label_val);
 
-                               if (name_len)
-                                       info->name = strcpy(name_ptr, name_val);
-
                                if (version_len)
                                        info->version = strcpy(version_ptr, version_val);
                        }
diff --git a/probe.c b/probe.c
index 1117044898b6abae11c29f5f1b0abab95c1edcd1..63d6f8c4ce945c7a7385935a929bb09d3788c18d 100644 (file)
--- a/probe.c
+++ b/probe.c
@@ -22,7 +22,7 @@ probe_path_tiny(const char *path)
 {
        struct probe_info *info = NULL;
        struct blkid_struct_probe pr = { };
-       char *type, *dev, *uuid, *label, *name, *version;
+       char *type, *dev, *uuid, *label, *version;
 
        if (probe_block((char *)path, &pr) == 0 && pr.id && !pr.err) {
                info = calloc_a(sizeof(*info),
@@ -30,7 +30,6 @@ probe_path_tiny(const char *path)
                                &dev,     strlen(pr.dev)      + 1,
                                &uuid,    strlen(pr.uuid)     + 1,
                                &label,   strlen(pr.label)    + 1,
-                               &name,    strlen(pr.name)     + 1,
                                &version, strlen(pr.version)  + 1);
 
                if (info) {
@@ -45,9 +44,6 @@ probe_path_tiny(const char *path)
                        if (pr.label[0])
                                info->label = strcpy(label, pr.label);
 
-                       if (pr.name[0])
-                               info->name = strcpy(name, pr.name);
-
                        if (pr.version[0])
                                info->version = strcpy(version, pr.version);
                }
diff --git a/probe.h b/probe.h
index b8557a4dbea35021c9d5bc85ad5125057b05dbf0..253ef6316636e402a2080fa46e1b243d2daf8efa 100644 (file)
--- a/probe.h
+++ b/probe.h
@@ -23,7 +23,6 @@ struct probe_info {
        char *dev;
        char *uuid;
        char *label;
-       char *name;
        char *version;
 };