Lines Matching defs:cache
43 * Find a dev struct in the cache by device name, if available.
48 blkid_dev blkid_get_dev(blkid_cache cache, const char *devname, int flags)
53 if (!cache || !devname)
56 list_for_each(p, &cache->bic_devs) {
62 printf("found devname %s in cache\n", tmp->bid_name));
75 dev->bid_cache = cache;
76 list_add_tail(&dev->bid_devs, &cache->bic_devs);
77 cache->bic_flags |= BLKID_BIC_FL_CHANGED;
81 dev = blkid_verify(cache, dev);
86 * cache for any entries that match on the type, uuid,
87 * and label, and verify them; if a cache entry can
91 list_for_each_safe(p, pnext, &cache->bic_devs) {
112 dev2 = blkid_verify(cache, dev2);
180 * Probe a single block device to add to the device cache.
182 static void probe_one(blkid_cache cache, const char *ptname,
190 /* See if we already have this device number in the cache. */
191 list_for_each_safe(p, pnext, &cache->bic_devs) {
197 dev = blkid_verify(cache, tmp);
228 if ((dev = blkid_get_dev(cache, device, BLKID_DEV_FIND)) &&
249 dev = blkid_get_dev(cache, devname, BLKID_DEV_NORMAL);
269 * This function initializes the UUID cache with devices from the LVM
300 static void lvm_probe_all(blkid_cache cache, int only_if_new)
351 probe_one(cache, lvm_device, dev, BLKID_PRI_LVM,
365 evms_probe_all(blkid_cache cache, int only_if_new)
383 probe_one(cache, device, makedev(ma, mi), BLKID_PRI_EVMS,
394 static int probe_all(blkid_cache cache, int only_if_new)
410 if (!cache)
413 if (cache->bic_flags & BLKID_BIC_FL_PROBED &&
414 time(0) - cache->bic_time < BLKID_PROBE_INTERVAL)
417 blkid_read_cache(cache);
418 evms_probe_all(cache, only_if_new);
420 lvm_probe_all(cache, only_if_new);
460 probe_one(cache, ptname, devs[which], 0,
467 * on it, remove the whole-disk dev from the cache if
471 list_for_each_safe(p, pnext, &cache->bic_devs) {
482 cache->bic_flags |= BLKID_BIC_FL_CHANGED;
497 probe_one(cache, ptnames[last], devs[last], 0,
505 probe_one(cache, ptname, devs[which], 0, only_if_new);
508 blkid_flush_cache(cache);
512 int blkid_probe_all(blkid_cache cache)
517 ret = probe_all(cache, 0);
518 cache->bic_time = time(0);
519 cache->bic_flags |= BLKID_BIC_FL_PROBED;
524 int blkid_probe_all_new(blkid_cache cache)
529 ret = probe_all(cache, 1);
538 blkid_cache cache = NULL;
547 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) {
548 fprintf(stderr, "%s: error creating cache (%d)\n",
552 if (blkid_probe_all(cache) < 0)
555 blkid_put_cache(cache);