Lines Matching defs:cache
368 * The buffer cache manages buffers, particularly:
377 * - Eviction or cache sizing.
448 struct dm_buffer_cache *cache;
454 static void lh_init(struct lock_history *lh, struct dm_buffer_cache *cache, bool write)
456 lh->cache = cache;
458 lh->no_previous = cache->num_locks;
465 if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep)
466 write_lock_bh(&lh->cache->trees[index].u.spinlock);
468 down_write(&lh->cache->trees[index].u.lock);
470 if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep)
471 read_lock_bh(&lh->cache->trees[index].u.spinlock);
473 down_read(&lh->cache->trees[index].u.lock);
480 if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep)
481 write_unlock_bh(&lh->cache->trees[index].u.spinlock);
483 up_write(&lh->cache->trees[index].u.lock);
485 if (static_branch_unlikely(&no_sleep_enabled) && lh->cache->no_sleep)
486 read_unlock_bh(&lh->cache->trees[index].u.spinlock);
488 up_read(&lh->cache->trees[index].u.lock);
821 * Passes ownership of the buffer to the cache. Returns false if the
871 * Removes buffer from cache, ownership of the buffer passes back to the caller.
1017 struct dm_buffer_cache cache; /* must be last member */
1043 * Default cache size: available memory divided by the ratio.
1048 * Total cache size set by the user.
1054 * at any time. If it disagrees, the user has changed cache size.
1149 * Use default if set to 0 and report the actual cache size used.
1535 b = cache_evict(&c->cache, LIST_CLEAN, is_clean, c);
1545 b = cache_evict(&c->cache, LIST_DIRTY, is_dirty, NULL);
1609 * For debugging, if we set the cache size to 1, no new buffers will
1696 cache_mark_many(&c->cache, LIST_DIRTY, LIST_CLEAN, cleaned, NULL);
1721 cache_iterate(&c->cache, LIST_DIRTY, write_one, &wc);
1732 if (cache_count(&c->cache, LIST_DIRTY) >
1733 cache_count(&c->cache, LIST_CLEAN) * DM_BUFIO_WRITEBACK_RATIO)
1749 if (cache_put(&c->cache, b) &&
1755 * This assumes you have already checked the cache to see if the buffer
1778 b = cache_get(&c->cache, block);
1802 * We mustn't insert into the cache until the B_READING state
1806 cache_insert(&c->cache, b);
1865 * Fast path, hopefully the block is already in the cache. No need
1868 b = cache_get(&c->cache, block);
1969 b = cache_get(&c->cache, block);
1971 /* already in cache */
2022 /* cache remove can fail if there are other holders */
2023 if (cache_remove(&c->cache, b)) {
2051 cache_mark(&c->cache, b, LIST_DIRTY);
2088 * Finally, we flush hardware disk cache.
2112 nr_buffers = cache_count(&c->cache, LIST_DIRTY);
2113 lru_iter_begin(&c->cache.lru[LIST_DIRTY], &it);
2130 cache_mark(&c->cache, b, LIST_CLEAN);
2202 b = cache_get(&c->cache, block);
2205 if (cache_remove(&c->cache, b))
2239 cache_remove_range(&c->cache, block, block + n_blocks, idle, __free_buffer_wake);
2339 cache_iterate(&c->cache, i, warn_leak, &warned);
2348 WARN_ON(cache_count(&c->cache, i));
2371 unsigned long count = cache_total(&c->cache);
2380 b = cache_evict(&c->cache, l,
2418 unsigned long count = cache_total(&c->cache);
2461 cache_init(&c->cache, num_locks, (flags & DM_BUFIO_CLIENT_NO_SLEEP) != 0);
2598 if (cache_count(&c->cache, i))
2599 DMERR("leaked buffer count %d: %lu", i, cache_count(&c->cache, i));
2602 WARN_ON(cache_count(&c->cache, i));
2604 cache_destroy(&c->cache);
2689 b = cache_evict(&c->cache, list_mode, select_for_evict, params);
2722 count = cache_total(&c->cache);
2942 MODULE_PARM_DESC(max_cache_size_bytes, "Size of metadata cache");
2963 MODULE_PARM_DESC(current_allocated_bytes, "Memory currently used by the cache");