]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: (gpt) fix PT offset
authorKarel Zak <kzak@redhat.com>
Mon, 11 Aug 2014 13:59:04 +0000 (15:59 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 11 Aug 2014 13:59:04 +0000 (15:59 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libblkid/src/partitions/gpt.c
libblkid/src/partitions/partitions.c

index 728b6ef3771d3ca8e0979fb55847bc8d269b5ae7..6ab4f7118f6170c3bd9e43854532fc6683979322 100644 (file)
@@ -348,7 +348,8 @@ static int probe_gpt_pt(blkid_probe pr,
        if (!ls)
                goto nothing;
 
-       tab = blkid_partlist_new_parttable(ls, "gpt", lba << 9);
+       tab = blkid_partlist_new_parttable(ls, "gpt",
+                               blkid_probe_get_sectorsize(pr) * lba);
        if (!tab)
                goto err;
 
index ce46fb28355facddde1154058c804e4486ec7a12..4853f97e29fc58b1664d8a41c9f7f424abd1cd89 100644 (file)
@@ -163,7 +163,7 @@ const struct blkid_chaindrv partitions_drv = {
 /* exported as opaque type "blkid_parttable" */
 struct blkid_struct_parttable {
        const char      *type;          /* partition table type */
-       blkid_loff_t    offset;         /* begin of the partition table */
+       blkid_loff_t    offset;         /* begin of the partition table (in bytes) */
        int             nparts;         /* number of partitions */
        blkid_partition parent;         /* parent of nested partition table */
        char            id[37];         /* PT identifier (e.g. UUID for GPT) */
@@ -173,8 +173,8 @@ struct blkid_struct_parttable {
 
 /* exported as opaque type "blkid_partition" */
 struct blkid_struct_partition {
-       blkid_loff_t    start;          /* begin of the partition */
-       blkid_loff_t    size;           /* size of the partitions */
+       blkid_loff_t    start;          /* begin of the partition (512-bytes sectors) */
+       blkid_loff_t    size;           /* size of the partitions (512-bytes sectors) */
 
        int             type;           /* partition type */
        char            typestr[37];    /* partition type string (GPT and Mac) */