]> err.no Git - util-linux/commitdiff
libblkid: use the new API in whole u-l-ng
authorKarel Zak <kzak@redhat.com>
Mon, 14 Sep 2009 21:33:01 +0000 (23:33 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 16 Sep 2009 08:57:24 +0000 (10:57 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/fsprobe.c
misc-utils/blkid.c
shlibs/blkid/src/evaluate.c
shlibs/blkid/src/superblocks/ext.c
shlibs/blkid/src/verify.c

index b47de0ec93f12d2f715fb493d6b4a93e6ef7650b..0341dab75be56b2368226a1d94e06b5e3b65f4b9 100644 (file)
@@ -133,9 +133,12 @@ fsprobe_get_value(const char *name, const char *devname)
                goto done;
        if (blkid_probe_set_device(blprobe, fd, 0, 0))
                goto done;
-       if (blkid_probe_set_request(blprobe, BLKID_PROBREQ_LABEL |
-                        BLKID_PROBREQ_UUID | BLKID_PROBREQ_TYPE ))
-               goto done;
+
+       blkid_probe_enable_superblocks(blprobe, 1);
+
+       blkid_probe_set_superblocks_flags(blprobe,
+               BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID | BLKID_SUBLKS_TYPE);
+
        if (blkid_do_safeprobe(blprobe))
                goto done;
        if (blkid_probe_lookup_value(blprobe, name, &data, NULL))
index 528e4a222b70e204e7c836ca6837956775c2edb1..3ab0c7ee6cd8015883cce36b7410a54c02ac6e2c 100644 (file)
@@ -551,12 +551,16 @@ int main(int argc, char **argv)
                pr = blkid_new_probe();
                if (!pr)
                        goto exit;
-               blkid_probe_set_request(pr,
-                               BLKID_PROBREQ_LABEL | BLKID_PROBREQ_UUID |
-                               BLKID_PROBREQ_TYPE | BLKID_PROBREQ_SECTYPE |
-                               BLKID_PROBREQ_USAGE | BLKID_PROBREQ_VERSION);
+
+               blkid_probe_enable_superblocks(pr, 1);
+
+               blkid_probe_set_superblocks_flags(pr,
+                               BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
+                               BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE |
+                               BLKID_SUBLKS_USAGE | BLKID_SUBLKS_VERSION);
+
                if (fltr_usage &&
-                   blkid_probe_filter_usage(pr, fltr_flag, fltr_usage))
+                   blkid_probe_filter_superblocks_usage(pr, fltr_flag, fltr_usage))
                        goto exit;
 
                for (i = 0; i < numdev; i++)
index b8154e4709501429047cc85be552bf8c8a79d45a..2308ea80a2c0403ed5d2bad37fe841068c8ce95b 100644 (file)
@@ -48,7 +48,9 @@ static int verify_tag(const char *devname, const char *name, const char *value)
        if (!pr)
                return -1;
 
-       blkid_probe_set_request(pr, BLKID_PROBREQ_LABEL | BLKID_PROBREQ_UUID);
+       blkid_probe_enable_superblocks(pr, TRUE);
+       blkid_probe_set_superblocks_flags(pr,
+                       BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID);
 
        fd = open(devname, O_RDONLY);
        if (fd < 0) {
index 5b190019082022e32eb9c8fd1f5a4351c4f1ac60..4bccd2e797b7bfaedbb0643b6d147a06aaad6654 100644 (file)
@@ -331,6 +331,8 @@ static struct ext2_super_block *ext_get_super(
 
 static void ext_get_info(blkid_probe pr, int ver, struct ext2_super_block *es)
 {
+       struct blkid_chain *chn = blkid_probe_get_chain(pr);
+
        DBG(DEBUG_PROBE, printf("ext2_sb.compat = %08X:%08X:%08X\n",
                   le32_to_cpu(es->s_feature_compat),
                   le32_to_cpu(es->s_feature_incompat),
@@ -344,7 +346,7 @@ static void ext_get_info(blkid_probe pr, int ver, struct ext2_super_block *es)
        if (le32_to_cpu(es->s_feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL)
                blkid_probe_set_uuid_as(pr, es->s_journal_uuid, "EXT_JOURNAL");
 
-       if (ver != 2 && (pr->probreq & BLKID_PROBREQ_SECTYPE) &&
+       if (ver != 2 && (chn->flags & BLKID_SUBLKS_SECTYPE) &&
            ((le32_to_cpu(es->s_feature_incompat) & EXT2_FEATURE_INCOMPAT_UNSUPPORTED) == 0))
                blkid_probe_set_value(pr, "SEC_TYPE",
                                (unsigned char *) "ext2",
index 78dafe7e68cc9a1d48ffc842e7ad3b4676ccb5f9..27360260094e606525907791b87177af876345d8 100644 (file)
@@ -110,9 +110,11 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
                return NULL;
        }
 
-       blkid_probe_set_request(cache->probe,
-               BLKID_PROBREQ_LABEL | BLKID_PROBREQ_UUID |
-               BLKID_PROBREQ_TYPE | BLKID_PROBREQ_SECTYPE);
+       blkid_probe_enable_superblocks(cache->probe, TRUE);
+
+       blkid_probe_set_superblocks_flags(cache->probe,
+               BLKID_SUBLKS_LABEL | BLKID_SUBLKS_UUID |
+               BLKID_SUBLKS_TYPE | BLKID_SUBLKS_SECTYPE);
 
        /*
         * If we already know the type, then try that first.
@@ -124,12 +126,12 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev)
                fltr[0] = dev->bid_type;
                fltr[1] = NULL;
 
-               blkid_probe_filter_types(cache->probe,
+               blkid_probe_filter_superblocks_type(cache->probe,
                                BLKID_FLTR_ONLYIN, fltr);
 
                if (!blkid_do_probe(cache->probe))
                        goto found_type;
-               blkid_probe_invert_filter(cache->probe);
+               blkid_probe_invert_superblocks_filter(cache->probe);
 
                /*
                 * Zap the device filesystem information and try again
@@ -166,7 +168,7 @@ found_type:
        }
 
        blkid_reset_probe(cache->probe);
-       blkid_probe_reset_filter(cache->probe);
+       blkid_probe_reset_superblocks_filter(cache->probe);
        close(fd);
        return dev;
 }