From 78e2edf796e7902b8ce615ca8388840ef1387194 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 21 Jul 2003 19:42:19 -0400 Subject: [PATCH] probe.c (blkid_known_fstype): New function which returns true if the filesystem type is one which this blkid library supports. --- lib/blkid/ChangeLog | 5 +++++ lib/blkid/blkid.h | 3 +++ lib/blkid/probe.c | 11 +++++++++++ 3 files changed, 19 insertions(+) diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 6976393..2d01b91 100644 --- a/lib/blkid/ChangeLog +++ b/lib/blkid/ChangeLog @@ -1,3 +1,8 @@ +2003-07-21 Theodore Ts'o + + * probe.c (blkid_known_fstype): New function which returns true if + the filesystem type is one which this blkid library supports. + 2003-07-20 Theodore Ts'o * probe.c: When revalidating a filesystem, delete the LABEL tag if diff --git a/lib/blkid/blkid.h b/lib/blkid/blkid.h index 83e070f..2c80fdf 100644 --- a/lib/blkid/blkid.h +++ b/lib/blkid/blkid.h @@ -69,6 +69,9 @@ extern blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, /* getsize.c */ extern blkid_loff_t blkid_get_dev_size(int fd); +/* probe.c */ +int blkid_known_fstype(const char *fstype); + /* read.c */ /* resolve.c */ diff --git a/lib/blkid/probe.c b/lib/blkid/probe.c index 1899e67..2421fff 100644 --- a/lib/blkid/probe.c +++ b/lib/blkid/probe.c @@ -437,6 +437,17 @@ found_type: return dev; } +int blkid_known_fstype(const char *fstype) +{ + struct blkid_magic *id; + + for (id = type_array; id->bim_type; id++) { + if (strcmp(fstype, id->bim_type) == 0) + return 1; + } + return 0; +} + #ifdef TEST_PROGRAM int main(int argc, char **argv) { -- 1.8.3.1