diff options
author | Karel Zak | 2009-01-27 17:25:06 +0100 |
---|---|---|
committer | Karel Zak | 2009-02-11 23:35:25 +0100 |
commit | a2f01a1c0ba7e8d6f546133195ee759715ef42f7 (patch) | |
tree | ac4b51b12299821f80f731db6c62b10049296c34 /libs/blkid/src/blkidP.h | |
parent | blkid: add lvm2 reg.test (diff) | |
download | kernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.tar.gz kernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.tar.xz kernel-qcow2-util-linux-a2f01a1c0ba7e8d6f546133195ee759715ef42f7.zip |
blkid: add blkid_do_safeprobe()
The function blkid_do_probe() is able to detect more filesystems on
the device
while(blkid_do_probe(pr) == 0)
...
but in many cases we need only one exact answer, and we also need to
be sure that there is not any other FS on the device.
For example it's possible to create valid LUKS (or vfat, ...) header
and valid linux swap header on the same device -- in such case the
device can be interpreted (by mount/swapon) in two completely
different ways. An ambivalent result is always error -- the library
never returns such result.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'libs/blkid/src/blkidP.h')
-rw-r--r-- | libs/blkid/src/blkidP.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/blkid/src/blkidP.h b/libs/blkid/src/blkidP.h index 2631966a1..f10c74749 100644 --- a/libs/blkid/src/blkidP.h +++ b/libs/blkid/src/blkidP.h @@ -134,10 +134,11 @@ struct blkid_idmag */ struct blkid_idinfo { - const char *name; /* FS/RAID name */ - int usage; /* BLKID_USAGE_* flag */ + const char *name; /* FS/RAID name */ + int usage; /* BLKID_USAGE_* flag */ + int flags; /* BLKID_IDINFO_* flags */ - /* probe function */ + /* probe function */ int (*probefunc)(blkid_probe pr, const struct blkid_idmag *mag); struct blkid_idmag magics[]; /* NULL or array with magic strings */ @@ -146,6 +147,13 @@ struct blkid_idinfo #define BLKID_NONE_MAGIC {{ NULL }} /* + * tolerant FS - can share the same device with more filesystems (e.g. typical + * on CD-ROMs). We need this flag to detect ambivalent results (e.g. valid fat + * and valid linux swap on the same device). + */ +#define BLKID_IDINFO_TOLERANT (1 << 1) + +/* * Minimum number of seconds between device probes, even when reading * from the cache. This is to avoid re-probing all devices which were * just probed by another program that does not share the cache. |