summaryrefslogtreecommitdiffstats
path: root/shlibs/blkid/src/probe.c
diff options
context:
space:
mode:
authorDavidlohr Bueso2010-11-11 14:34:52 +0100
committerKarel Zak2010-11-15 10:02:24 +0100
commite8ae49476e5391fc477adb75d891c6b43543ded8 (patch)
tree809840eb0a4bed73b0c910ecbadb955732fbf290 /shlibs/blkid/src/probe.c
parenthwclock: [m68k] unbreak FTBFS with recent (>= 2.4.18?) kernels (diff)
downloadkernel-qcow2-util-linux-e8ae49476e5391fc477adb75d891c6b43543ded8.tar.gz
kernel-qcow2-util-linux-e8ae49476e5391fc477adb75d891c6b43543ded8.tar.xz
kernel-qcow2-util-linux-e8ae49476e5391fc477adb75d891c6b43543ded8.zip
libblkid: add blkid_probe_get_sectors()
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>
Diffstat (limited to 'shlibs/blkid/src/probe.c')
-rw-r--r--shlibs/blkid/src/probe.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c
index a748f2e24..3698b99b3 100644
--- a/shlibs/blkid/src/probe.c
+++ b/shlibs/blkid/src/probe.c
@@ -1188,6 +1188,17 @@ unsigned int blkid_probe_get_sectorsize(blkid_probe pr)
}
/**
+ * 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
*