]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: add ID_PART_ENTRY_{OFFSET,SIZE,DISK}
authorKarel Zak <kzak@redhat.com>
Mon, 23 May 2011 11:06:45 +0000 (13:06 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 23 May 2011 11:06:45 +0000 (13:06 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkidP.h
shlibs/blkid/src/partitions/partitions.c

index b78488f45383e9635f74179c46bfb95665f1a07a..aeeebc16512c6e79f0e929fd657e62940fb0aa90 100644 (file)
@@ -121,7 +121,7 @@ struct blkid_chaindrv {
 
 #define BLKID_NVALS_SUBLKS     14
 #define BLKID_NVALS_TOPLGY     5
-#define BLKID_NVALS_PARTS      10
+#define BLKID_NVALS_PARTS      13
 
 /* Max number of all values in probing result */
 #define BLKID_NVALS             (BLKID_NVALS_SUBLKS + \
index 76cb21d4085edd1fafae937de6920c2c3c79036f..c132c9ebe4633e0e1f260ac0b0b14c0fe1efe75e 100644 (file)
@@ -708,6 +708,7 @@ static int blkid_partitions_probe_partition(blkid_probe pr)
        if (par) {
                const char *v;
                blkid_parttable tab = blkid_partition_get_table(par);
+               dev_t disk = blkid_probe_get_devno(disk_pr);
 
                if (tab) {
                        v = blkid_parttable_get_type(tab);
@@ -741,6 +742,14 @@ static int blkid_partitions_probe_partition(blkid_probe pr)
 
                blkid_probe_sprintf_value(pr, "PART_ENTRY_NUMBER",
                                "%d", blkid_partition_get_partno(par));
+
+               blkid_probe_sprintf_value(pr, "PART_ENTRY_OFFSET", "%jd",
+                               blkid_partition_get_start(par));
+               blkid_probe_sprintf_value(pr, "PART_ENTRY_SIZE", "%jd",
+                               blkid_partition_get_size(par));
+
+               blkid_probe_sprintf_value(pr, "PART_ENTRY_DISK", "%u:%u",
+                               major(disk), minor(disk));
        }
        rc = 0;
 nothing: