-struct cache_detail *cache_find(char *name)
-{
- struct list_head *l;
-
- spin_lock(&cache_list_lock);
- list_for_each(l, &cache_list) {
- struct cache_detail *cd = list_entry(l, struct cache_detail, others);
-
- if (strcmp(cd->name, name)==0) {
- atomic_inc(&cd->inuse);
- spin_unlock(&cache_list_lock);
- return cd;
- }
- }
- spin_unlock(&cache_list_lock);
- return NULL;
-}
-
-/* cache_drop must be called on any cache returned by
- * cache_find, after it has been used
- */
-void cache_drop(struct cache_detail *detail)
-{
- atomic_dec(&detail->inuse);
-}
-