diff options
Diffstat (limited to 'libblkid/src')
-rw-r--r-- | libblkid/src/blkid.h.in | 2 | ||||
-rw-r--r-- | libblkid/src/libblkid.sym | 4 | ||||
-rw-r--r-- | libblkid/src/probe.c | 16 |
3 files changed, 22 insertions, 0 deletions
diff --git a/libblkid/src/blkid.h.in b/libblkid/src/blkid.h.in index d7bbced7f..06e2c1771 100644 --- a/libblkid/src/blkid.h.in +++ b/libblkid/src/blkid.h.in @@ -243,6 +243,8 @@ extern blkid_loff_t blkid_probe_get_offset(blkid_probe pr) __ul_attribute__((nonnull)); extern unsigned int blkid_probe_get_sectorsize(blkid_probe pr) __ul_attribute__((nonnull)); +extern int blkid_probe_set_sectorsize(blkid_probe pr, unsigned int sz) + __ul_attribute__((nonnull)); extern blkid_loff_t blkid_probe_get_sectors(blkid_probe pr) __ul_attribute__((nonnull)); diff --git a/libblkid/src/libblkid.sym b/libblkid/src/libblkid.sym index 6b3cf0805..cd76d6592 100644 --- a/libblkid/src/libblkid.sym +++ b/libblkid/src/libblkid.sym @@ -164,3 +164,7 @@ global: BLKID_2.25 { blkid_partlist_get_partition_by_partno; } BLKID_2.23; + +BLKID_2.30 { + blkid_probe_set_sectorsize; +} BLKID_2.25; diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c index ea50f5a6b..df90a82e0 100644 --- a/libblkid/src/probe.c +++ b/libblkid/src/probe.c @@ -1672,6 +1672,22 @@ unsigned int blkid_probe_get_sectorsize(blkid_probe pr) } /** + * blkid_probe_set_sectorsize: + * @pr: probe + * @sz: new size (to overwrite system default) + * + * Note that blkid_probe_set_device() resets this setting. Use it after + * blkid_probe_set_device() and before any probing call. + * + * Returns: 0 or <0 in case of error + */ +int blkid_probe_set_sectorsize(blkid_probe pr, unsigned int sz) +{ + pr->blkssz = sz; + return 0; +} + +/** * blkid_probe_get_sectors: * @pr: probe * |