Lines Matching refs:cookie
26 struct fscache_cookie *cookie = fscache_cres_cookie(cres);
30 if (!fscache_cache_is_live(cookie->volume->cache)) {
35 state = fscache_cookie_state(cookie);
36 _enter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
46 wait_var_event(&cookie->state,
47 fscache_cookie_state(cookie) != state);
61 return cookie->volume->cache->ops->begin_operation(cres, want_state);
72 struct fscache_cookie *cookie,
81 cres->cache_priv = cookie;
83 cres->debug_id = cookie->debug_id;
84 cres->inval_counter = cookie->inval_counter;
86 if (!fscache_begin_cookie_access(cookie, why))
90 spin_lock(&cookie->lock);
92 state = fscache_cookie_state(cookie);
93 _enter("c=%08x{%u},%x", cookie->debug_id, state, want_state);
108 WARN(1, "Can't use cookie in state %u\n", cookie->state);
115 spin_unlock(&cookie->lock);
116 if (!cookie->volume->cache->ops->begin_operation(cres, want_state))
121 spin_unlock(&cookie->lock);
122 trace_fscache_access(cookie->debug_id, refcount_read(&cookie->ref),
123 atomic_read(&cookie->n_accesses),
125 timeo = wait_var_event_timeout(&cookie->state,
126 fscache_cookie_state(cookie) != state, 20 * HZ);
128 pr_warn("%s: cookie state change wait timed out: cookie->state=%u state=%u",
129 __func__, fscache_cookie_state(cookie), state);
130 fscache_print_cookie(cookie, 'O');
136 spin_unlock(&cookie->lock);
140 fscache_end_cookie_access(cookie, fscache_access_io_not_live);
146 struct fscache_cookie *cookie)
148 return fscache_begin_operation(cres, cookie, FSCACHE_WANT_PARAMS,
154 struct fscache_cookie *cookie)
156 return fscache_begin_operation(cres, cookie, FSCACHE_WANT_PARAMS,
165 * @cookie: The cookie referring to the cache object
174 struct fscache_cookie *cookie)
183 if (!fscache_cookie_valid(cookie))
195 fscache_use_cookie(cookie, true);
248 void __fscache_write_to_cache(struct fscache_cookie *cookie,
276 if (fscache_begin_operation(cres, cookie, FSCACHE_WANT_WRITE,
307 void __fscache_resize_cookie(struct fscache_cookie *cookie, loff_t new_size)
311 trace_fscache_resize(cookie, new_size);
312 if (fscache_begin_operation(&cres, cookie, FSCACHE_WANT_WRITE,
315 set_bit(FSCACHE_COOKIE_NEEDS_UPDATE, &cookie->flags);
321 cookie->volume->cache->ops->resize_cookie(&cres, new_size);