From: Theodore Ts'o Date: Mon, 21 Jul 2003 23:42:19 +0000 (-0400) Subject: probe.c (blkid_known_fstype): New function which returns true if X-Git-Tag: E2FSPROGS-1_34~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=78e2edf796e7902b8ce615ca8388840ef1387194;p=thirdparty%2Fe2fsprogs.git probe.c (blkid_known_fstype): New function which returns true if the filesystem type is one which this blkid library supports. --- diff --git a/lib/blkid/ChangeLog b/lib/blkid/ChangeLog index 697639397..2d01b919d 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 83e070faf..2c80fdf1b 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 1899e67f5..2421fff19 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) {