diff options
author | Karel Zak | 2013-02-04 11:28:09 +0100 |
---|---|---|
committer | Karel Zak | 2013-02-04 11:28:09 +0100 |
commit | cd0fe5c1659d4144610ffd76500002e98b873e0b (patch) | |
tree | 889cb6f7bd291fbc3b6eb0e690af826fa2288224 /libblkid/src/blkid.sym | |
parent | newgrp: more robust crypt() usage (diff) | |
download | kernel-qcow2-util-linux-cd0fe5c1659d4144610ffd76500002e98b873e0b.tar.gz kernel-qcow2-util-linux-cd0fe5c1659d4144610ffd76500002e98b873e0b.tar.xz kernel-qcow2-util-linux-cd0fe5c1659d4144610ffd76500002e98b873e0b.zip |
libblkid: add blkid_probe_step_back()
It seems that blkid_do_probe() is too high-level solution for some
mkfs programs (for example ext4 mkfs supports "undo" so all write
operations has to be implemented by filesystem specific functions).
The new function blkid_probe_step_back() resets internal libblkid
buffers and move probing stuff one step back. It means that the
previously used probing function will be called again in the next
blkid_do_probe() call. This allows to modify on-disk data and check
for backup superblocks or alternative magic strings. Something like:
while (blkid_do_probe(pr) == 0) {
... get SBMAGIC_OFFSET and SBMAGIC len ...
... use your private seek & write() ...
blkid_probe_step_back(pr);
}
References: https://bugzilla.redhat.com/show_bug.cgi?id=902512
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libblkid/src/blkid.sym')
-rw-r--r-- | libblkid/src/blkid.sym | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libblkid/src/blkid.sym b/libblkid/src/blkid.sym index 62f981f4c..cf2a16f94 100644 --- a/libblkid/src/blkid.sym +++ b/libblkid/src/blkid.sym @@ -146,3 +146,10 @@ global: blkid_do_wipe; } BLKID_2.20; +/* + * symbols since util-linux 2.23 + */ +BLKID_2.23 { +global: + blkid_probe_step_back; +} BLKID_2.21; |