Lines Matching full:cache
46 * Find a dev struct in the cache by device name, if available.
51 blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
56 if (!cache || !devname)
59 list_for_each(p, &cache->bic_devs) {
65 printf("found devname %s in cache\n", tmp->bid_name));
76 dev->bid_cache = cache;
77 list_add_tail(&dev->bid_devs, &cache->bic_devs);
78 cache->bic_flags |= BLKID_BIC_FL_CHANGED;
82 dev = blkid_verify(cache, dev);
91 * Probe a single block device to add to the device cache.
93 static void probe_one(blkid_cache cache, const char *ptname,
101 /* See if we already have this device number in the cache. */
102 list_for_each(p, &cache->bic_devs) {
112 dev = blkid_verify(cache, tmp);
130 if ((dev = blkid_get_dev(cache, device, BLKID_DEV_FIND)) &&
145 dev = blkid_get_dev(cache, devname, BLKID_DEV_NORMAL);
281 static void dm_probe_all(blkid_cache cache, int only_if_new)
320 probe_one(cache, device, dev, BLKID_PRI_DM, only_if_new);
337 * This function initializes the UUID cache with devices from the LVM
369 static void lvm_probe_all(blkid_cache cache, int only_if_new)
420 probe_one(cache, lvm_device, dev, BLKID_PRI_LVM,
434 evms_probe_all(blkid_cache cache, int only_if_new)
452 probe_one(cache, device, makedev(ma, mi), BLKID_PRI_EVMS,
463 static int probe_all(blkid_cache cache, int only_if_new)
478 if (!cache)
481 if (cache->bic_flags & BLKID_BIC_FL_PROBED &&
482 time(0) - cache->bic_time < BLKID_PROBE_INTERVAL)
485 blkid_read_cache(cache);
487 dm_probe_all(cache, only_if_new);
489 evms_probe_all(cache, only_if_new);
491 lvm_probe_all(cache, only_if_new);
531 probe_one(cache, ptname, devs[which], 0,
545 probe_one(cache, ptnames[last], devs[last], 0,
553 probe_one(cache, ptname, devs[which], 0, only_if_new);
556 blkid_flush_cache(cache);
560 int blkid_probe_all(blkid_cache cache)
565 ret = probe_all(cache, 0);
566 cache->bic_time = time(0);
567 cache->bic_flags |= BLKID_BIC_FL_PROBED;
572 int blkid_probe_all_new(blkid_cache cache)
577 ret = probe_all(cache, 1);
586 blkid_cache cache = NULL;
595 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) {
596 fprintf(stderr, "%s: error creating cache (%d)\n",
600 if (blkid_probe_all(cache) < 0)
603 blkid_put_cache(cache);