diff options
author | Karel Zak | 2009-09-15 22:53:25 +0200 |
---|---|---|
committer | Karel Zak | 2009-09-16 10:57:23 +0200 |
commit | f319b5cadd9f7f9b5d9f807faf645768aa8ecccc (patch) | |
tree | 82b5ec2fbd1597d2d6d4561b26c6a5d4eac0d8e0 /shlibs/blkid/src/probe.c | |
parent | libblkid: add blkid_probe_get_{size,sectorsize,devno} (diff) | |
download | kernel-qcow2-util-linux-f319b5cadd9f7f9b5d9f807faf645768aa8ecccc.tar.gz kernel-qcow2-util-linux-f319b5cadd9f7f9b5d9f807faf645768aa8ecccc.tar.xz kernel-qcow2-util-linux-f319b5cadd9f7f9b5d9f807faf645768aa8ecccc.zip |
libblkid: allow to change dimension of probing area
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'shlibs/blkid/src/probe.c')
-rw-r--r-- | shlibs/blkid/src/probe.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/shlibs/blkid/src/probe.c b/shlibs/blkid/src/probe.c index a3d08114e..d3da7165b 100644 --- a/shlibs/blkid/src/probe.c +++ b/shlibs/blkid/src/probe.c @@ -509,6 +509,39 @@ int blkid_probe_set_device(blkid_probe pr, int fd, return 0; } +int blkid_probe_get_dimension(blkid_probe pr, + blkid_loff_t *off, blkid_loff_t *size) +{ + if (!pr) + return -1; + + *off = pr->off; + *size = pr->size; + return 0; +} + +int blkid_probe_set_dimension(blkid_probe pr, + blkid_loff_t off, blkid_loff_t size) +{ + if (!pr) + return -1; + + DBG(DEBUG_LOWPROBE, printf( + "changing probing area: size=%llu, off=%llu " + "-to-> size=%llu, off=%llu\n", + (unsigned long long) pr->size, + (unsigned long long) pr->off, + (unsigned long long) size, + (unsigned long long) off)); + + pr->off = off; + pr->size = size; + + blkid_probe_reset_buffer(pr); + + return 0; +} + /** * blkid_do_probe: * @pr: prober |