Lines Matching refs:cache
51 struct ovl_dir_cache *cache; member
175 struct ovl_dir_cache *cache = od->cache; in ovl_cache_put() local
177 WARN_ON(cache->refcount <= 0); in ovl_cache_put()
178 cache->refcount--; in ovl_cache_put()
179 if (!cache->refcount) { in ovl_cache_put()
180 if (ovl_dir_cache(dentry) == cache) in ovl_cache_put()
183 ovl_cache_free(&cache->entries); in ovl_cache_put()
184 kfree(cache); in ovl_cache_put()
270 struct ovl_dir_cache *cache = od->cache; in ovl_dir_reset() local
274 if (cache && ovl_dentry_version_get(dentry) != cache->version) { in ovl_dir_reset()
276 od->cache = NULL; in ovl_dir_reset()
322 list_for_each(p, &od->cache->entries) { in ovl_seek_cursor()
334 struct ovl_dir_cache *cache; in ovl_cache_get() local
336 cache = ovl_dir_cache(dentry); in ovl_cache_get()
337 if (cache && ovl_dentry_version_get(dentry) == cache->version) { in ovl_cache_get()
338 cache->refcount++; in ovl_cache_get()
339 return cache; in ovl_cache_get()
343 cache = kzalloc(sizeof(struct ovl_dir_cache), GFP_KERNEL); in ovl_cache_get()
344 if (!cache) in ovl_cache_get()
347 cache->refcount = 1; in ovl_cache_get()
348 INIT_LIST_HEAD(&cache->entries); in ovl_cache_get()
350 res = ovl_dir_read_merged(dentry, &cache->entries); in ovl_cache_get()
352 ovl_cache_free(&cache->entries); in ovl_cache_get()
353 kfree(cache); in ovl_cache_get()
357 cache->version = ovl_dentry_version_get(dentry); in ovl_cache_get()
358 ovl_set_dir_cache(dentry, cache); in ovl_cache_get()
360 return cache; in ovl_cache_get()
375 if (!od->cache) { in ovl_iterate()
376 struct ovl_dir_cache *cache; in ovl_iterate() local
378 cache = ovl_cache_get(dentry); in ovl_iterate()
379 if (IS_ERR(cache)) in ovl_iterate()
380 return PTR_ERR(cache); in ovl_iterate()
382 od->cache = cache; in ovl_iterate()
386 while (od->cursor != &od->cache->entries) { in ovl_iterate()
426 if (od->cache) in ovl_dir_llseek()
481 if (od->cache) { in ovl_dir_release()