]> err.no Git - util-linux/commitdiff
libblkid: add PART_ENTRY_{SCHEME,NUMBER}
authorKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2010 22:01:38 +0000 (23:01 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 18 Feb 2010 22:01:38 +0000 (23:01 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkidP.h
shlibs/blkid/src/partitions/partitions.c

index 7dc39fc30ddb526f07f223dda2b6f7dca22e7414..c9b2bcd18c06718491f75de9c6b30263c68e239d 100644 (file)
@@ -119,7 +119,7 @@ struct blkid_chaindrv {
 
 #define BLKID_NVALS_SUBLKS     14
 #define BLKID_NVALS_TOPLGY     5
-#define BLKID_NVALS_PARTS      1
+#define BLKID_NVALS_PARTS      8
 
 /* Max number of all values in probing result */
 #define BLKID_NVALS             (BLKID_NVALS_SUBLKS + \
index d3ba6f2943d05572708dcdbd1de5d0bbc731bffb..35fd8b28c4fc94e98c2a33ae226763e104bab5ad 100644 (file)
@@ -713,6 +713,14 @@ static int blkid_partitions_probe_partition(blkid_probe pr)
        par = blkid_partlist_devno_to_partition(ls, devno);
        if (par) {
                const char *v;
+               blkid_parttable tab = blkid_partition_get_table(par);
+
+               if (tab) {
+                       v = blkid_parttable_get_type(tab);
+                       if (v)
+                               blkid_probe_set_value(pr, "PART_ENTRY_SCHEME",
+                                       (unsigned char *) v, strlen(v) + 1);
+               }
 
                v = blkid_partition_get_name(par);
                if (v)
@@ -736,6 +744,9 @@ static int blkid_partitions_probe_partition(blkid_probe pr)
                if (blkid_partition_get_flags(par))
                        blkid_probe_sprintf_value(pr, "PART_ENTRY_FLAGS",
                                "0x%llx", blkid_partition_get_flags(par));
+
+               blkid_probe_sprintf_value(pr, "PART_ENTRY_NUMBER",
+                               "%d", blkid_partition_get_partno(par));
        }
        rc = 0;
 nothing: