12 #define FSCACHE_DEBUG_LEVEL CACHE
13 #include <linux/module.h>
14 #include <linux/slab.h>
75 if (tag != ERR_PTR(-
ENOMEM)) {
79 list_del_init(&tag->
link);
104 _leave(
" = NULL [no cache]");
109 spin_lock(&cookie->
lock);
117 cache =
object->cache;
118 if (object->
state >= FSCACHE_OBJECT_DYING ||
122 spin_unlock(&cookie->
lock);
123 _leave(
" = %p [parent]", cache);
130 spin_unlock(&cookie->
lock);
131 _leave(
" = NULL [cookie ub,ni]");
135 spin_unlock(&cookie->
lock);
137 if (!cookie->
def->select_cache)
141 tag = cookie->
def->select_cache(cookie->
parent->netfs_data,
146 if (tag == ERR_PTR(-
ENOMEM)) {
147 _leave(
" = NULL [nomem tag]");
152 _leave(
" = NULL [unbacked tag]");
166 _leave(
" = %p [first]", cache);
189 memset(cache, 0,
sizeof(*cache));
198 INIT_LIST_HEAD(&cache->
link);
228 ifsdef->
state = FSCACHE_OBJECT_ACTIVE;
251 cache->
fsdef = ifsdef;
282 cache->
tag->name, cache->
ops->name);
289 printk(
KERN_ERR "FS-Cache: Cache tag '%s' already in use\n", tagname);
338 list_move_tail(&object->
cache_link, dying_objects);
342 spin_lock(&object->
lock);
345 spin_unlock(&object->
lock);
378 list_del_init(&cache->
link);
385 cache->
ops->sync_cache(cache);
391 cache->
ops->dissociate_pages(cache);
399 fscache_withdraw_all_objects(cache, &dying_objects);
403 _debug(
"wait for finish");
406 _debug(
"wait for clearance");
410 ASSERT(list_empty(&dying_objects));
415 fscache_release_cache_tag(cache->
tag);