]> err.no Git - util-linux/commitdiff
libblkid: allow to read in sectors
authorKarel Zak <kzak@redhat.com>
Tue, 15 Sep 2009 20:55:05 +0000 (22:55 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Sep 2009 08:57:24 +0000 (10:57 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
shlibs/blkid/src/blkidP.h
shlibs/blkid/src/probe.c

index b6fa563459d20abb0053375cad2757c97f1e5765..6187e1eebf0ef2d0a5af1dec41af9341bf911a48 100644 (file)
@@ -371,6 +371,8 @@ extern void blkid_free_dev(blkid_dev dev);
 unsigned char *blkid_probe_get_buffer(blkid_probe pr,
                                 blkid_loff_t off, blkid_loff_t len);
 
+extern unsigned char *blkid_probe_get_sector(blkid_probe pr, unsigned int sector);
+
 extern int blkid_probe_get_dimension(blkid_probe pr,
                        blkid_loff_t *off, blkid_loff_t *size);
 
index d3da7165b9275dc9dc1045d86eaecd433f074f8e..b72bcb40a542ceba7e7573be8758a4292f6fc6a5 100644 (file)
@@ -720,6 +720,13 @@ done:
        return count ? 0 : 1;
 }
 
+/* same sa blkid_probe_get_buffer() but works with 512-sectors */
+unsigned char *blkid_probe_get_sector(blkid_probe pr, unsigned int sector)
+{
+       return pr ? blkid_probe_get_buffer(pr,
+                       ((blkid_loff_t) sector) << 9, 0x200) : NULL;
+}
+
 struct blkid_prval *blkid_probe_assign_value(
                        blkid_probe pr, const char *name)
 {