Lines Matching refs:h

45 static void cache_init(struct cache_head *h, struct cache_detail *detail)  in cache_init()  argument
48 INIT_HLIST_NODE(&h->cache_list); in cache_init()
49 h->flags = 0; in cache_init()
50 kref_init(&h->ref); in cache_init()
51 h->expiry_time = now + CACHE_NEW_EXPIRY; in cache_init()
55 h->last_refresh = now; in cache_init()
186 struct cache_head *h) in cache_make_negative() argument
188 set_bit(CACHE_NEGATIVE, &h->flags); in cache_make_negative()
189 trace_cache_entry_make_negative(detail, h); in cache_make_negative()
193 struct cache_head *h, in cache_entry_update() argument
197 detail->update(h, new); in cache_entry_update()
198 trace_cache_entry_update(detail, h); in cache_entry_update()
200 cache_make_negative(detail, h); in cache_entry_update()
248 static inline int cache_is_valid(struct cache_head *h) in cache_is_valid() argument
250 if (!test_bit(CACHE_VALID, &h->flags)) in cache_is_valid()
254 if (test_bit(CACHE_NEGATIVE, &h->flags)) in cache_is_valid()
269 static int try_to_negate_entry(struct cache_detail *detail, struct cache_head *h) in try_to_negate_entry() argument
274 rv = cache_is_valid(h); in try_to_negate_entry()
276 cache_make_negative(detail, h); in try_to_negate_entry()
277 cache_fresh_locked(h, seconds_since_boot()+CACHE_NEW_EXPIRY, in try_to_negate_entry()
282 cache_fresh_unlocked(h, detail); in try_to_negate_entry()
287 struct cache_head *h, struct cache_req *rqstp) in cache_check_rcu() argument
293 rv = cache_is_valid(h); in cache_check_rcu()
296 refresh_age = (h->expiry_time - h->last_refresh); in cache_check_rcu()
297 age = seconds_since_boot() - h->last_refresh; in cache_check_rcu()
303 (h->expiry_time != 0 && age > refresh_age/2)) { in cache_check_rcu()
306 switch (detail->cache_upcall(detail, h)) { in cache_check_rcu()
308 rv = try_to_negate_entry(detail, h); in cache_check_rcu()
311 cache_fresh_unlocked(h, detail); in cache_check_rcu()
317 if (!cache_defer_req(rqstp, h)) { in cache_check_rcu()
322 rv = cache_is_valid(h); in cache_check_rcu()
347 struct cache_head *h, struct cache_req *rqstp) in cache_check() argument
351 rv = cache_check_rcu(detail, h, rqstp); in cache_check()
353 cache_put(h, detail); in cache_check()
1213 static int cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) in cache_pipe_upcall() argument
1219 if (test_bit(CACHE_CLEANED, &h->flags)) in cache_pipe_upcall()
1238 if (test_bit(CACHE_PENDING, &h->flags)) { in cache_pipe_upcall()
1239 crq->item = cache_get(h); in cache_pipe_upcall()
1241 trace_cache_entry_upcall(detail, h); in cache_pipe_upcall()
1254 int sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h) in sunrpc_cache_pipe_upcall() argument
1256 if (test_and_set_bit(CACHE_PENDING, &h->flags)) in sunrpc_cache_pipe_upcall()
1258 return cache_pipe_upcall(detail, h); in sunrpc_cache_pipe_upcall()
1263 struct cache_head *h) in sunrpc_cache_pipe_upcall_timeout() argument
1267 trace_cache_entry_no_listener(detail, h); in sunrpc_cache_pipe_upcall_timeout()
1270 return sunrpc_cache_pipe_upcall(detail, h); in sunrpc_cache_pipe_upcall_timeout()
1298 int h, l; in qword_get() local
1300 h = hex_to_bin(bp[0]); in qword_get()
1301 if (h < 0) in qword_get()
1308 *dest++ = (h << 4) | l; in qword_get()
1904 void sunrpc_cache_unhash(struct cache_detail *cd, struct cache_head *h) in sunrpc_cache_unhash() argument
1907 if (!hlist_unhashed(&h->cache_list)){ in sunrpc_cache_unhash()
1908 sunrpc_begin_cache_remove_entry(h, cd); in sunrpc_cache_unhash()
1910 sunrpc_end_cache_remove_entry(h, cd); in sunrpc_cache_unhash()