Lines Matching full:cache
2 * save.c - write the cache struct to disk
54 * Write out the cache struct to the cache file on disk.
56 int blkid_flush_cache(blkid_cache cache)
66 if (!cache)
69 if (list_empty(&cache->bic_devs) ||
70 !(cache->bic_flags & BLKID_BIC_FL_CHANGED)) {
71 DBG(DEBUG_SAVE, printf("skipping cache file write\n"));
75 filename = cache->bic_filename ? cache->bic_filename: BLKID_CACHE_FILE;
77 /* If we can't write to the cache file, then don't even try */
81 printf("can't write to cache file %s\n", filename));
87 * that in case of error we don't overwrite the cache file.
88 * If the cache file doesn't yet exist, it isn't a regular
111 printf("writing cache file %s (really %s)\n",
119 list_for_each(p, &cache->bic_devs) {
128 cache->bic_flags &= ~BLKID_BIC_FL_CHANGED;
137 printf("unlinked temp cache %s\n", opened));
150 printf("moved temp cache %s\n", opened));
163 blkid_cache cache = NULL;
169 "Test loading/saving a cache (filename)\n", argv[0]);
173 if ((ret = blkid_get_cache(&cache, "/dev/null")) != 0) {
174 fprintf(stderr, "%s: error creating cache (%d)\n",
178 if ((ret = blkid_probe_all(cache)) < 0) {
182 cache->bic_filename = blkid_strdup(argv[1]);
184 if ((ret = blkid_flush_cache(cache)) < 0) {
185 fprintf(stderr, "error (%d) saving cache\n", ret);
189 blkid_put_cache(cache);