diff options
author | Karel Zak | 2011-05-23 13:06:45 +0200 |
---|---|---|
committer | Karel Zak | 2011-05-23 13:06:45 +0200 |
commit | ffb06a150591d480d1cb35f595c1798a334f6010 (patch) | |
tree | a02dea2517a65f61e138231129df5cf9b1bf2190 /shlibs/blkid | |
parent | libblkid: use partno for partitions mapped by DM (diff) | |
download | kernel-qcow2-util-linux-ffb06a150591d480d1cb35f595c1798a334f6010.tar.gz kernel-qcow2-util-linux-ffb06a150591d480d1cb35f595c1798a334f6010.tar.xz kernel-qcow2-util-linux-ffb06a150591d480d1cb35f595c1798a334f6010.zip |
libblkid: add ID_PART_ENTRY_{OFFSET,SIZE,DISK}
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid')
-rw-r--r-- | shlibs/blkid/src/blkidP.h | 2 | ||||
-rw-r--r-- | shlibs/blkid/src/partitions/partitions.c | 9 |
2 files changed, 10 insertions, 1 deletions
diff --git a/shlibs/blkid/src/blkidP.h b/shlibs/blkid/src/blkidP.h index b78488f45..aeeebc165 100644 --- a/shlibs/blkid/src/blkidP.h +++ b/shlibs/blkid/src/blkidP.h @@ -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 + \ diff --git a/shlibs/blkid/src/partitions/partitions.c b/shlibs/blkid/src/partitions/partitions.c index 76cb21d40..c132c9ebe 100644 --- a/shlibs/blkid/src/partitions/partitions.c +++ b/shlibs/blkid/src/partitions/partitions.c @@ -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: |