Lines Matching refs:cache
11 struct cachefiles_cache *cache = object->volume->cache; in cachefiles_ondemand_fd_release() local
14 XA_STATE(xas, &cache->reqs, 0); in cachefiles_ondemand_fd_release()
16 xa_lock(&cache->reqs); in cachefiles_ondemand_fd_release()
31 xa_unlock(&cache->reqs); in cachefiles_ondemand_fd_release()
33 xa_erase(&cache->ondemand_ids, object_id); in cachefiles_ondemand_fd_release()
36 cachefiles_put_unbind_pincount(cache); in cachefiles_ondemand_fd_release()
44 struct cachefiles_cache *cache = object->volume->cache; in cachefiles_ondemand_fd_write_iter() local
54 cachefiles_begin_secure(cache, &saved_cred); in cachefiles_ondemand_fd_write_iter()
56 cachefiles_end_secure(cache, saved_cred); in cachefiles_ondemand_fd_write_iter()
84 struct cachefiles_cache *cache = object->volume->cache; in cachefiles_ondemand_fd_ioctl() local
91 if (!test_bit(CACHEFILES_ONDEMAND_MODE, &cache->flags)) in cachefiles_ondemand_fd_ioctl()
95 req = xa_erase(&cache->reqs, id); in cachefiles_ondemand_fd_ioctl()
117 int cachefiles_ondemand_copen(struct cachefiles_cache *cache, char *args) in cachefiles_ondemand_copen() argument
126 if (!test_bit(CACHEFILES_ONDEMAND_MODE, &cache->flags)) in cachefiles_ondemand_copen()
148 req = xa_erase(&cache->reqs, id); in cachefiles_ondemand_copen()
187 struct cachefiles_cache *cache; in cachefiles_ondemand_get_fd() local
195 cache = object->volume->cache; in cachefiles_ondemand_get_fd()
197 ret = xa_alloc_cyclic(&cache->ondemand_ids, &object_id, NULL, in cachefiles_ondemand_get_fd()
199 &cache->ondemand_id_next, GFP_KERNEL); in cachefiles_ondemand_get_fd()
224 cachefiles_get_unbind_pincount(cache); in cachefiles_ondemand_get_fd()
231 xa_erase(&cache->ondemand_ids, object_id); in cachefiles_ondemand_get_fd()
237 ssize_t cachefiles_ondemand_daemon_read(struct cachefiles_cache *cache, in cachefiles_ondemand_daemon_read() argument
245 XA_STATE(xas, &cache->reqs, cache->req_id_next); in cachefiles_ondemand_daemon_read()
252 xa_lock(&cache->reqs); in cachefiles_ondemand_daemon_read()
254 if (!req && cache->req_id_next > 0) { in cachefiles_ondemand_daemon_read()
256 req = xas_find_marked(&xas, cache->req_id_next - 1, CACHEFILES_REQ_NEW); in cachefiles_ondemand_daemon_read()
259 xa_unlock(&cache->reqs); in cachefiles_ondemand_daemon_read()
267 xa_unlock(&cache->reqs); in cachefiles_ondemand_daemon_read()
272 cache->req_id_next = xas.xa_index + 1; in cachefiles_ondemand_daemon_read()
273 xa_unlock(&cache->reqs); in cachefiles_ondemand_daemon_read()
291 xa_erase(&cache->reqs, id); in cachefiles_ondemand_daemon_read()
301 xa_erase(&cache->reqs, id); in cachefiles_ondemand_daemon_read()
315 struct cachefiles_cache *cache = object->volume->cache; in cachefiles_ondemand_send_req() local
317 XA_STATE(xas, &cache->reqs, 0); in cachefiles_ondemand_send_req()
320 if (!test_bit(CACHEFILES_ONDEMAND_MODE, &cache->flags)) in cachefiles_ondemand_send_req()
323 if (test_bit(CACHEFILES_DEAD, &cache->flags)) in cachefiles_ondemand_send_req()
357 if (test_bit(CACHEFILES_DEAD, &cache->flags)) { in cachefiles_ondemand_send_req()
387 wake_up_all(&cache->daemon_pollwq); in cachefiles_ondemand_send_req()