This function allows users to obtain the device's 512-byte sector count.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
blkid_new_probe_from_filename
blkid_probe_get_devno
blkid_probe_get_sectorsize
+blkid_probe_get_sectors
blkid_probe_get_size
blkid_probe_set_device
blkid_reset_probe
extern blkid_loff_t blkid_probe_get_size(blkid_probe pr);
extern blkid_loff_t blkid_probe_get_offset(blkid_probe pr);
extern unsigned int blkid_probe_get_sectorsize(blkid_probe pr);
+extern blkid_loff_t blkid_probe_get_sectors(blkid_probe pr);
extern int blkid_probe_get_fd(blkid_probe pr);
blkid_probe_get_devno;
blkid_probe_get_partitions;
blkid_probe_get_sectorsize;
+ blkid_probe_get_sectors;
blkid_probe_get_size;
blkid_probe_get_topology;
blkid_probe_invert_partitions_filter;
return pr->blkssz;
}
+/**
+ * blkid_probe_get_sectors:
+ * @pr: probe
+ *
+ * Returns: 512-byte sector count or -1 in case of error.
+ */
+blkid_loff_t blkid_probe_get_sectors(blkid_probe pr)
+{
+ return pr ? pr->size >> 9 : -1;
+}
+
/**
* blkid_probe_numof_values:
* @pr: probe